Skip to content

Instantly share code, notes, and snippets.

Created September 24, 2013 16:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/6687766 to your computer and use it in GitHub Desktop.
Save anonymous/6687766 to your computer and use it in GitHub Desktop.
# Generated by ffi-gen. Please do not change this file by hand.
require 'ffi'
module Jpeg
extend FFI::Library
ffi_lib 'libjpeg'
def self.attach_function(name, *_)
begin; super; rescue FFI::NotFoundError => e
(class << self; self; end).class_eval { define_method(name) { |*_| raise e } }
end
end
LIB_VERSION = 80
LIB_VERSION_MAJOR = 8
LIB_VERSION_MINOR = 4
DCTSIZE = 8
DCTSIZE2 = 64
NUM_QUANT_TBLS = 4
NUM_HUFF_TBLS = 4
NUM_ARITH_TBLS = 16
MAX_COMPS_IN_SCAN = 4
MAX_SAMP_FACTOR = 4
C_MAX_BLOCKS_IN_MCU = 10
D_MAX_BLOCKS_IN_MCU = 10
JMSG_LENGTH_MAX = 200
JMSG_STR_PARM_MAX = 80
JPOOL_PERMANENT = 0
JPOOL_IMAGE = 1
JPOOL_NUMPOOLS = 2
def jpp(arglist)
arglist
end
SUSPENDED = 0
HEADER_OK = 1
HEADER_TABLES_ONLY = 2
REACHED_SOS = 1
REACHED_EOI = 2
ROW_COMPLETED = 3
SCAN_COMPLETED = 4
RST0 = 0xD0
EOI = 0xD9
APP0 = 0xE0
COM = 0xFE
# a 3-D sample array: top index is color
#
# <em>This entry is only for documentation and no real method.</em>
#
# @method _callback_jblock_(int)
# @param [Integer] int
# @return [Integer]
# @scope class
callback :jblock, [:int], :short
# DCT coefficient quantization tables.
#
# = Fields:
# :quantval ::
# (Array<Integer>) quantization step for each coefficient
# :sent_table ::
# (Integer) TRUE when table has been output
class JQUANTTBL < FFI::Struct
layout :quantval, [:ushort, 64],
:sent_table, :int
end
# Huffman coding tables.
#
# = Fields:
# :bits ::
# (Array<Integer>) bits(k) = # of symbols with codes of
# :huffval ::
# (Array<Integer>) The symbols, in order of incr code length
# :sent_table ::
# (Integer) TRUE when table has been output
class JHUFFTBL < FFI::Struct
layout :bits, [:uchar, 17],
:huffval, [:uchar, 256],
:sent_table, :int
end
# Basic info about one component (color channel).
#
# = Fields:
# :component_id ::
# (Integer) identifier for this component (0..255)
# :component_index ::
# (Integer) its index in SOF or cinfo->comp_info()
# :h_samp_factor ::
# (Integer) horizontal sampling factor (1..4)
# :v_samp_factor ::
# (Integer) vertical sampling factor (1..4)
# :quant_tbl_no ::
# (Integer) quantization table selector (0..3)
# :dc_tbl_no ::
# (Integer) DC entropy table selector (0..3)
# :ac_tbl_no ::
# (Integer) AC entropy table selector (0..3)
# :width_in_blocks ::
# (Integer) Component's size in DCT blocks.
# Any dummy blocks added to complete an MCU are not counted; therefore
# these values do not depend on whether a scan is interleaved or not.
# :height_in_blocks ::
# (Integer)
# :dct_h_scaled_size ::
# (Integer) Size of a DCT block in samples,
# reflecting any scaling we choose to apply during the DCT step.
# Values from 1 to 16 are supported.
# Note that different components may receive different DCT scalings.
# :dct_v_scaled_size ::
# (Integer)
# :downsampled_width ::
# (Integer) actual width in samples
# :downsampled_height ::
# (Integer) actual height in samples
# :component_needed ::
# (Integer) do we need the value of this component?
# :mcu_width ::
# (Integer) number of blocks per MCU, horizontally
# :mcu_height ::
# (Integer) number of blocks per MCU, vertically
# :mcu_blocks ::
# (Integer) MCU_width * MCU_height
# :mcu_sample_width ::
# (Integer) MCU width in samples: MCU_width * DCT_h_scaled_size
# :last_col_width ::
# (Integer) # of non-dummy blocks across in last MCU
# :last_row_height ::
# (Integer) # of non-dummy blocks down in last MCU
# :quant_table ::
# (JQUANTTBL) Saved quantization table for component; NULL if none yet saved.
# See jdinput.c comments about the need for this information.
# This field is currently used only for decompression.
# :dct_table ::
# (FFI::Pointer(*Void)) Private per-component storage for DCT or IDCT subsystem.
class ComponentInfo < FFI::Struct
layout :component_id, :int,
:component_index, :int,
:h_samp_factor, :int,
:v_samp_factor, :int,
:quant_tbl_no, :int,
:dc_tbl_no, :int,
:ac_tbl_no, :int,
:width_in_blocks, :uint,
:height_in_blocks, :uint,
:dct_h_scaled_size, :int,
:dct_v_scaled_size, :int,
:downsampled_width, :uint,
:downsampled_height, :uint,
:component_needed, :int,
:mcu_width, :int,
:mcu_height, :int,
:mcu_blocks, :int,
:mcu_sample_width, :int,
:last_col_width, :int,
:last_row_height, :int,
:quant_table, JQUANTTBL,
:dct_table, :pointer
end
# The script for encoding a multiple-scan file is an array of these:
#
# = Fields:
# :comps_in_scan ::
# (Integer) number of components encoded in this scan
# :component_index ::
# (Array<Integer>) their SOF/comp_info() indexes
# :ss ::
# (Integer)
# :se ::
# (Integer) progressive JPEG spectral selection parms
# :ah ::
# (Integer)
# :al ::
# (Integer) progressive JPEG successive approx. parms
class ScanInfo < FFI::Struct
layout :comps_in_scan, :int,
:component_index, [:int, 4],
:ss, :int,
:se, :int,
:ah, :int,
:al, :int
end
# The decompressor can save APPn and COM markers in a list of these:
#
# = Fields:
# :next_ ::
# (FFI::Pointer(*MarkerStruct)) next in list, or NULL
# :marker ::
# (Integer) marker code: JPEG_COM, or JPEG_APP0+n
# :original_length ::
# (Integer) # bytes of data in the file
# :data_length ::
# (Integer) # bytes of data saved at data()
# :data ::
# (FFI::Pointer(*JOCTET)) the data contained in the marker
class MarkerStruct < FFI::Struct
layout :next_, :pointer,
:marker, :uchar,
:original_length, :uint,
:data_length, :uint,
:data, :pointer
end
# Known color spaces.
#
# <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:j_color_space).</em>
#
# === Options:
# :jcs_unknown ::
#
# :jcs_grayscale ::
# error/unspecified
# :jcs_rgb ::
# monochrome
# :jcs_y_cb_cr ::
# red/green/blue
# :jcs_cmyk ::
# Y/Cb/Cr (also known as YUV)
# :jcs_ycck ::
# C/M/Y/K
#
# @method _enum_j_color_space_
# @return [Symbol]
# @scope class
enum :j_color_space, [
:jcs_unknown, 0,
:jcs_grayscale, 1,
:jcs_rgb, 2,
:jcs_y_cb_cr, 3,
:jcs_cmyk, 4,
:jcs_ycck, 5
]
# DCT/IDCT algorithm options.
#
# <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:j_dct_method).</em>
#
# === Options:
# :jdct_islow ::
#
# :jdct_ifast ::
# slow but accurate integer algorithm
# :jdct_float ::
# faster, less accurate integer method
#
# @method _enum_j_dct_method_
# @return [Symbol]
# @scope class
enum :j_dct_method, [
:jdct_islow, 0,
:jdct_ifast, 1,
:jdct_float, 2
]
# Dithering options for decompression.
#
# <em>This entry is only for documentation and no real method. The FFI::Enum can be accessed via #enum_type(:j_dither_mode).</em>
#
# === Options:
# :jdither_none ::
#
# :jdither_ordered ::
# no dithering
# :jdither_fs ::
# simple ordered dither
#
# @method _enum_j_dither_mode_
# @return [Symbol]
# @scope class
enum :j_dither_mode, [
:jdither_none, 0,
:jdither_ordered, 1,
:jdither_fs, 2
]
# Routines that are to be used by both halves of the library are declared
# to receive a pointer to this structure. There are no actual instances of
# jpeg_common_struct, only of jpeg_compress_struct and jpeg_decompress_struct.
#
# = Fields:
# :err ::
# (FFI::Pointer(*ErrorMgr))
# :mem ::
# (FFI::Pointer(*MemoryMgr))
# :progress ::
# (FFI::Pointer(*ProgressMgr))
# :client_data ::
# (FFI::Pointer(*Void))
# :is_decompressor ::
# (Integer)
# :global_state ::
# (Integer) Fields common to both master struct types
class CommonStruct < FFI::Struct
layout :err, :pointer,
:mem, :pointer,
:progress, :pointer,
:client_data, :pointer,
:is_decompressor, :int,
:global_state, :int
end
# (Not documented)
class CompMaster < FFI::Struct
layout :dummy, :char
end
# (Not documented)
class CMainController < FFI::Struct
layout :dummy, :char
end
# (Not documented)
class CPrepController < FFI::Struct
layout :dummy, :char
end
# (Not documented)
class CCoefController < FFI::Struct
layout :dummy, :char
end
# (Not documented)
class MarkerWriter < FFI::Struct
layout :dummy, :char
end
# (Not documented)
class ColorConverter < FFI::Struct
layout :dummy, :char
end
# (Not documented)
class Downsampler < FFI::Struct
layout :dummy, :char
end
# (Not documented)
class ForwardDct < FFI::Struct
layout :dummy, :char
end
# (Not documented)
class EntropyEncoder < FFI::Struct
layout :dummy, :char
end
# Master record for a compression instance
#
# = Fields:
# :err ::
# (FFI::Pointer(*ErrorMgr))
# :mem ::
# (FFI::Pointer(*MemoryMgr))
# :progress ::
# (FFI::Pointer(*ProgressMgr))
# :client_data ::
# (FFI::Pointer(*Void))
# :is_decompressor ::
# (Integer)
# :global_state ::
# (Integer) Fields shared with jpeg_decompress_struct
# :dest ::
# (FFI::Pointer(*DestinationMgr)) Destination for compressed data
# :image_width ::
# (Integer) input image width
# :image_height ::
# (Integer) input image height
# :input_components ::
# (Integer) # of color components in input image
# :in_color_space ::
# (Symbol from _enum_j_color_space_) colorspace of input image
# :input_gamma ::
# (Float) image gamma of input image
# :scale_num ::
# (Integer) Compression parameters --- these fields must be set before calling
# jpeg_start_compress(). We recommend calling jpeg_set_defaults() to
# initialize everything to reasonable defaults, then changing anything
# the application specifically wants to change. That way you won't get
# burnt when new parameters are added. Also note that there are several
# helper routines to simplify changing parameters.
# :scale_denom ::
# (Integer) fraction by which to scale image
# :width ::
# (Integer) scaled JPEG image width
# :height ::
# (Integer) scaled JPEG image height
# :data_precision ::
# (Integer) bits of precision in image data
# :num_components ::
# (Integer) # of color components in JPEG image
# :color_space ::
# (Symbol from _enum_j_color_space_) colorspace of JPEG image
# :comp_info ::
# (ComponentInfo)
# :quant_tbl_ptrs ::
# (Array<JQUANTTBL>) comp_info(i) describes component that appears i'th in SOF
# :q_scale_factor ::
# (Array<Integer>)
# :dc_huff_tbl_ptrs ::
# (Array<JHUFFTBL>) ptrs to coefficient quantization tables, or NULL if not defined,
# and corresponding scale factors (percentage, initialized 100).
# :ac_huff_tbl_ptrs ::
# (Array<JHUFFTBL>)
# :arith_dc_l ::
# (Array<Integer>) L values for DC arith-coding tables
# :arith_dc_u ::
# (Array<Integer>) U values for DC arith-coding tables
# :arith_ac_k ::
# (Array<Integer>) Kx values for AC arith-coding tables
# :num_scans ::
# (Integer) # of entries in scan_info array
# :scan_info ::
# (ScanInfo) script for multi-scan file, or NULL
# :raw_data_in ::
# (Integer) TRUE=caller supplies downsampled data
# :arith_code ::
# (Integer) TRUE=arithmetic coding, FALSE=Huffman
# :optimize_coding ::
# (Integer) TRUE=optimize entropy encoding parms
# :ccir601_sampling ::
# (Integer) TRUE=first samples are cosited
# :do_fancy_downsampling ::
# (Integer) TRUE=apply fancy downsampling
# :smoothing_factor ::
# (Integer) 1..100, or 0 for no input smoothing
# :dct_method ::
# (Symbol from _enum_j_dct_method_) DCT algorithm selector
# :restart_interval ::
# (Integer) MCUs per restart, or 0 for no restart
# :restart_in_rows ::
# (Integer) if > 0, MCU rows per restart interval
# :write_jfif_header ::
# (Integer) should a JFIF marker be written?
# :jfif_major_version ::
# (Integer) What to write for the JFIF version number
# :jfif_minor_version ::
# (Integer)
# :density_unit ::
# (Integer) JFIF code for pixel size units
# :x_density ::
# (Integer) Horizontal pixel density
# :y_density ::
# (Integer) Vertical pixel density
# :write_adobe_marker ::
# (Integer) should an Adobe marker be written?
# :next_scanline ::
# (Integer) 0 .. image_height-1
# :progressive_mode ::
# (Integer) TRUE if scan script uses progressive mode
# :max_h_samp_factor ::
# (Integer) largest h_samp_factor
# :max_v_samp_factor ::
# (Integer) largest v_samp_factor
# :min_dct_h_scaled_size ::
# (Integer) smallest DCT_h_scaled_size of any component
# :min_dct_v_scaled_size ::
# (Integer) smallest DCT_v_scaled_size of any component
# :total_i_mcu_rows ::
# (Integer) # of iMCU rows to be input to coef ctlr
# :comps_in_scan ::
# (Integer) # of JPEG components in this scan
# :cur_comp_info ::
# (Array<ComponentInfo>)
# :mc_us_per_row ::
# (Integer) # of MCUs across the image
# :mcu_rows_in_scan ::
# (Integer) # of MCU rows in the image
# :blocks_in_mcu ::
# (Integer) # of DCT blocks per MCU
# :mcu_membership ::
# (Array<Integer>)
# :ss ::
# (Integer) i'th block in an MCU
# :se ::
# (Integer)
# :ah ::
# (Integer)
# :al ::
# (Integer) progressive JPEG parameters for scan
# :block_size ::
# (Integer) the basic DCT block size: 1..16
# :natural_order ::
# (FFI::Pointer(*Int)) natural-order position array
# :lim_se ::
# (Integer) min( Se, DCTSIZE2-1 )
# :master ::
# (CompMaster) Links to compression subobjects (methods and private variables of modules)
# :main ::
# (CMainController)
# :prep ::
# (CPrepController)
# :coef ::
# (CCoefController)
# :marker ::
# (MarkerWriter)
# :cconvert ::
# (ColorConverter)
# :downsample ::
# (Downsampler)
# :fdct ::
# (ForwardDct)
# :entropy ::
# (EntropyEncoder)
# :script_space ::
# (ScanInfo) workspace for jpeg_simple_progression
# :script_space_size ::
# (Integer)
class CompressStruct < FFI::Struct
layout :err, :pointer,
:mem, :pointer,
:progress, :pointer,
:client_data, :pointer,
:is_decompressor, :int,
:global_state, :int,
:dest, :pointer,
:image_width, :uint,
:image_height, :uint,
:input_components, :int,
:in_color_space, :j_color_space,
:input_gamma, :double,
:scale_num, :uint,
:scale_denom, :uint,
:width, :uint,
:height, :uint,
:data_precision, :int,
:num_components, :int,
:color_space, :j_color_space,
:comp_info, ComponentInfo,
:quant_tbl_ptrs, [JQUANTTBL, 4],
:q_scale_factor, [:int, 4],
:dc_huff_tbl_ptrs, [JHUFFTBL, 4],
:ac_huff_tbl_ptrs, [JHUFFTBL, 4],
:arith_dc_l, [:uchar, 16],
:arith_dc_u, [:uchar, 16],
:arith_ac_k, [:uchar, 16],
:num_scans, :int,
:scan_info, ScanInfo,
:raw_data_in, :int,
:arith_code, :int,
:optimize_coding, :int,
:ccir601_sampling, :int,
:do_fancy_downsampling, :int,
:smoothing_factor, :int,
:dct_method, :j_dct_method,
:restart_interval, :uint,
:restart_in_rows, :int,
:write_jfif_header, :int,
:jfif_major_version, :uchar,
:jfif_minor_version, :uchar,
:density_unit, :uchar,
:x_density, :ushort,
:y_density, :ushort,
:write_adobe_marker, :int,
:next_scanline, :uint,
:progressive_mode, :int,
:max_h_samp_factor, :int,
:max_v_samp_factor, :int,
:min_dct_h_scaled_size, :int,
:min_dct_v_scaled_size, :int,
:total_i_mcu_rows, :uint,
:comps_in_scan, :int,
:cur_comp_info, [ComponentInfo, 4],
:mc_us_per_row, :uint,
:mcu_rows_in_scan, :uint,
:blocks_in_mcu, :int,
:mcu_membership, [:int, 10],
:ss, :int,
:se, :int,
:ah, :int,
:al, :int,
:block_size, :int,
:natural_order, :pointer,
:lim_se, :int,
:master, CompMaster,
:main, CMainController,
:prep, CPrepController,
:coef, CCoefController,
:marker, MarkerWriter,
:cconvert, ColorConverter,
:downsample, Downsampler,
:fdct, ForwardDct,
:entropy, EntropyEncoder,
:script_space, ScanInfo,
:script_space_size, :int
end
# (Not documented)
class DecompMaster < FFI::Struct
layout :dummy, :char
end
# (Not documented)
class DMainController < FFI::Struct
layout :dummy, :char
end
# (Not documented)
class DCoefController < FFI::Struct
layout :dummy, :char
end
# (Not documented)
class DPostController < FFI::Struct
layout :dummy, :char
end
# (Not documented)
class InputController < FFI::Struct
layout :dummy, :char
end
# (Not documented)
class MarkerReader < FFI::Struct
layout :dummy, :char
end
# (Not documented)
class EntropyDecoder < FFI::Struct
layout :dummy, :char
end
# (Not documented)
class InverseDct < FFI::Struct
layout :dummy, :char
end
# (Not documented)
class Upsampler < FFI::Struct
layout :dummy, :char
end
# (Not documented)
class ColorDeconverter < FFI::Struct
layout :dummy, :char
end
# (Not documented)
class ColorQuantizer < FFI::Struct
layout :dummy, :char
end
# Master record for a decompression instance
#
# = Fields:
# :err ::
# (FFI::Pointer(*ErrorMgr))
# :mem ::
# (FFI::Pointer(*MemoryMgr))
# :progress ::
# (FFI::Pointer(*ProgressMgr))
# :client_data ::
# (FFI::Pointer(*Void))
# :is_decompressor ::
# (Integer)
# :global_state ::
# (Integer) Fields shared with jpeg_compress_struct
# :src ::
# (FFI::Pointer(*SourceMgr)) Source of compressed data
# :image_width ::
# (Integer) nominal image width (from SOF marker)
# :image_height ::
# (Integer) nominal image height
# :num_components ::
# (Integer) # of color components in JPEG image
# :color_space ::
# (Symbol from _enum_j_color_space_) colorspace of JPEG image
# :out_color_space ::
# (Symbol from _enum_j_color_space_) colorspace for output
# :scale_num ::
# (Integer)
# :scale_denom ::
# (Integer) fraction by which to scale image
# :output_gamma ::
# (Float) image gamma wanted in output
# :buffered_image ::
# (Integer) TRUE=multiple output passes
# :raw_data_out ::
# (Integer) TRUE=downsampled data wanted
# :dct_method ::
# (Symbol from _enum_j_dct_method_) IDCT algorithm selector
# :do_fancy_upsampling ::
# (Integer) TRUE=apply fancy upsampling
# :do_block_smoothing ::
# (Integer) TRUE=apply interblock smoothing
# :quantize_colors ::
# (Integer) TRUE=colormapped output wanted
# :dither_mode ::
# (Symbol from _enum_j_dither_mode_) type of color dithering to use
# :two_pass_quantize ::
# (Integer) TRUE=use two-pass color quantization
# :desired_number_of_colors ::
# (Integer) max # colors to use in created colormap
# :enable_1pass_quant ::
# (Integer) enable future use of 1-pass quantizer
# :enable_external_quant ::
# (Integer) enable future use of external colormap
# :enable_2pass_quant ::
# (Integer) enable future use of 2-pass quantizer
# :output_width ::
# (Integer) scaled image width
# :output_height ::
# (Integer) scaled image height
# :out_color_components ::
# (Integer) # of color components in out_color_space
# :output_components ::
# (Integer) # of color components returned
# :rec_outbuf_height ::
# (Integer) min recommended height of scanline buffer
# :actual_number_of_colors ::
# (Integer) number of entries in use
# :colormap ::
# (FFI::Pointer(JSAMPARRAY)) The color map as a 2-D pixel array
# :output_scanline ::
# (Integer) 0 .. output_height-1
# :input_scan_number ::
# (Integer) Number of SOS markers seen so far
# :input_i_mcu_row ::
# (Integer) Number of iMCU rows completed
# :output_scan_number ::
# (Integer) Nominal scan number being displayed
# :output_i_mcu_row ::
# (Integer) Number of iMCU rows read
# :coef_bits ::
# (FFI::Pointer(*)) -1 or current Al value for each coef
# :quant_tbl_ptrs ::
# (Array<JQUANTTBL>) Quantization and Huffman tables are carried forward across input
# datastreams when processing abbreviated JPEG datastreams.
# :dc_huff_tbl_ptrs ::
# (Array<JHUFFTBL>) ptrs to coefficient quantization tables, or NULL if not defined
# :ac_huff_tbl_ptrs ::
# (Array<JHUFFTBL>)
# :data_precision ::
# (Integer) bits of precision in image data
# :comp_info ::
# (ComponentInfo)
# :is_baseline ::
# (Integer) TRUE if Baseline SOF0 encountered
# :progressive_mode ::
# (Integer) TRUE if SOFn specifies progressive mode
# :arith_code ::
# (Integer) TRUE=arithmetic coding, FALSE=Huffman
# :arith_dc_l ::
# (Array<Integer>) L values for DC arith-coding tables
# :arith_dc_u ::
# (Array<Integer>) U values for DC arith-coding tables
# :arith_ac_k ::
# (Array<Integer>) Kx values for AC arith-coding tables
# :restart_interval ::
# (Integer) MCUs per restart interval, or 0 for no restart
# :saw_jfif_marker ::
# (Integer) TRUE iff a JFIF APP0 marker was found
# :jfif_major_version ::
# (Integer) JFIF version number
# :jfif_minor_version ::
# (Integer)
# :density_unit ::
# (Integer) JFIF code for pixel size units
# :x_density ::
# (Integer) Horizontal pixel density
# :y_density ::
# (Integer) Vertical pixel density
# :saw_adobe_marker ::
# (Integer) TRUE iff an Adobe APP14 marker was found
# :adobe_transform ::
# (Integer) Color transform code from Adobe marker
# :ccir601_sampling ::
# (Integer) TRUE=first samples are cosited
# :marker_list ::
# (MarkerStruct) Head of list of saved markers
# :max_h_samp_factor ::
# (Integer) largest h_samp_factor
# :max_v_samp_factor ::
# (Integer) largest v_samp_factor
# :min_dct_h_scaled_size ::
# (Integer) smallest DCT_h_scaled_size of any component
# :min_dct_v_scaled_size ::
# (Integer) smallest DCT_v_scaled_size of any component
# :total_i_mcu_rows ::
# (Integer) # of iMCU rows in image
# :sample_range_limit ::
# (FFI::Pointer(*JSAMPLE)) table for fast range-limiting
# :comps_in_scan ::
# (Integer) # of JPEG components in this scan
# :cur_comp_info ::
# (Array<ComponentInfo>)
# :mc_us_per_row ::
# (Integer) # of MCUs across the image
# :mcu_rows_in_scan ::
# (Integer) # of MCU rows in the image
# :blocks_in_mcu ::
# (Integer) # of DCT blocks per MCU
# :mcu_membership ::
# (Array<Integer>)
# :ss ::
# (Integer) i'th block in an MCU
# :se ::
# (Integer)
# :ah ::
# (Integer)
# :al ::
# (Integer) progressive JPEG parameters for scan
# :block_size ::
# (Integer) the basic DCT block size: 1..16
# :natural_order ::
# (FFI::Pointer(*Int)) natural-order position array for entropy decode
# :lim_se ::
# (Integer) min( Se, DCTSIZE2-1 ) for entropy decode
# :unread_marker ::
# (Integer) This field is shared between entropy decoder and marker parser.
# It is either zero or the code of a JPEG marker that has been
# read from the data source, but has not yet been processed.
# :master ::
# (DecompMaster) Links to decompression subobjects (methods, private variables of modules)
# :main ::
# (DMainController)
# :coef ::
# (DCoefController)
# :post ::
# (DPostController)
# :inputctl ::
# (InputController)
# :marker ::
# (MarkerReader)
# :entropy ::
# (EntropyDecoder)
# :idct ::
# (InverseDct)
# :upsample ::
# (Upsampler)
# :cconvert ::
# (ColorDeconverter)
# :cquantize ::
# (ColorQuantizer)
class DecompressStruct < FFI::Struct
layout :err, :pointer,
:mem, :pointer,
:progress, :pointer,
:client_data, :pointer,
:is_decompressor, :int,
:global_state, :int,
:src, :pointer,
:image_width, :uint,
:image_height, :uint,
:num_components, :int,
:color_space, :j_color_space,
:out_color_space, :j_color_space,
:scale_num, :uint,
:scale_denom, :uint,
:output_gamma, :double,
:buffered_image, :int,
:raw_data_out, :int,
:dct_method, :j_dct_method,
:do_fancy_upsampling, :int,
:do_block_smoothing, :int,
:quantize_colors, :int,
:dither_mode, :j_dither_mode,
:two_pass_quantize, :int,
:desired_number_of_colors, :int,
:enable_1pass_quant, :int,
:enable_external_quant, :int,
:enable_2pass_quant, :int,
:output_width, :uint,
:output_height, :uint,
:out_color_components, :int,
:output_components, :int,
:rec_outbuf_height, :int,
:actual_number_of_colors, :int,
:colormap, :pointer,
:output_scanline, :uint,
:input_scan_number, :int,
:input_i_mcu_row, :uint,
:output_scan_number, :int,
:output_i_mcu_row, :uint,
:coef_bits, :pointer,
:quant_tbl_ptrs, [JQUANTTBL, 4],
:dc_huff_tbl_ptrs, [JHUFFTBL, 4],
:ac_huff_tbl_ptrs, [JHUFFTBL, 4],
:data_precision, :int,
:comp_info, ComponentInfo,
:is_baseline, :int,
:progressive_mode, :int,
:arith_code, :int,
:arith_dc_l, [:uchar, 16],
:arith_dc_u, [:uchar, 16],
:arith_ac_k, [:uchar, 16],
:restart_interval, :uint,
:saw_jfif_marker, :int,
:jfif_major_version, :uchar,
:jfif_minor_version, :uchar,
:density_unit, :uchar,
:x_density, :ushort,
:y_density, :ushort,
:saw_adobe_marker, :int,
:adobe_transform, :uchar,
:ccir601_sampling, :int,
:marker_list, MarkerStruct,
:max_h_samp_factor, :int,
:max_v_samp_factor, :int,
:min_dct_h_scaled_size, :int,
:min_dct_v_scaled_size, :int,
:total_i_mcu_rows, :uint,
:sample_range_limit, :pointer,
:comps_in_scan, :int,
:cur_comp_info, [ComponentInfo, 4],
:mc_us_per_row, :uint,
:mcu_rows_in_scan, :uint,
:blocks_in_mcu, :int,
:mcu_membership, [:int, 10],
:ss, :int,
:se, :int,
:ah, :int,
:al, :int,
:block_size, :int,
:natural_order, :pointer,
:lim_se, :int,
:unread_marker, :int,
:master, DecompMaster,
:main, DMainController,
:coef, DCoefController,
:post, DPostController,
:inputctl, InputController,
:marker, MarkerReader,
:entropy, EntropyDecoder,
:idct, InverseDct,
:upsample, Upsampler,
:cconvert, ColorDeconverter,
:cquantize, ColorQuantizer
end
# (Not documented)
#
# = Fields:
# :i ::
# (Array<Integer>)
# :s ::
# (Array<Integer>)
class ErrorMgrMsgParm < FFI::Union
layout :i, [:int, 8],
:s, [:char, 80]
end
# Error handler object
#
# = Fields:
# :error_exit ::
# (FFI::Pointer(*))
# :emit_message ::
# (FFI::Pointer(*))
# :output_message ::
# (FFI::Pointer(*))
# :format_message ::
# (FFI::Pointer(*))
# :reset_error_mgr ::
# (FFI::Pointer(*))
# :msg_code ::
# (Integer) The message ID code and any parameters are saved here.
# A message can have one string parameter or up to 8 int parameters.
# :msg_parm ::
# (ErrorMgrMsgParm)
# :trace_level ::
# (Integer) max msg_level that will be displayed
# :num_warnings ::
# (Integer) number of corrupt-data warnings
# :message_table ::
# (FFI::Pointer(**CharS)) Library errors
# :last_jpeg_message ::
# (Integer) Table contains strings 0..last_jpeg_message
# :addon_message_table ::
# (FFI::Pointer(**CharS)) Non-library errors
# :first_addon_message ::
# (Integer) code for first string in addon table
# :last_addon_message ::
# (Integer) code for last string in addon table
class ErrorMgr < FFI::Struct
layout :error_exit, :pointer,
:emit_message, :pointer,
:output_message, :pointer,
:format_message, :pointer,
:reset_error_mgr, :pointer,
:msg_code, :int,
:msg_parm, ErrorMgrMsgParm.by_value,
:trace_level, :int,
:num_warnings, :long,
:message_table, :pointer,
:last_jpeg_message, :int,
:addon_message_table, :pointer,
:first_addon_message, :int,
:last_addon_message, :int
end
# Progress monitor object
#
# = Fields:
# :progress_monitor ::
# (FFI::Pointer(*))
# :pass_counter ::
# (Integer) work units completed in this pass
# :pass_limit ::
# (Integer) total number of work units in this pass
# :completed_passes ::
# (Integer) passes completed so far
# :total_passes ::
# (Integer) total number of passes expected
class ProgressMgr < FFI::Struct
layout :progress_monitor, :pointer,
:pass_counter, :long,
:pass_limit, :long,
:completed_passes, :int,
:total_passes, :int
end
# Data destination object for compression
#
# = Fields:
# :next_output_byte ::
# (FFI::Pointer(*JOCTET)) => next byte to write in buffer
# :free_in_buffer ::
# (Integer)
# :init_destination ::
# (FFI::Pointer(*))
# :empty_output_buffer ::
# (FFI::Pointer(*))
# :term_destination ::
# (FFI::Pointer(*))
class DestinationMgr < FFI::Struct
layout :next_output_byte, :pointer,
:free_in_buffer, :int,
:init_destination, :pointer,
:empty_output_buffer, :pointer,
:term_destination, :pointer
end
# Data source object for decompression
#
# = Fields:
# :next_input_byte ::
# (FFI::Pointer(*JOCTET)) => next byte to read from buffer
# :bytes_in_buffer ::
# (Integer)
# :init_source ::
# (FFI::Pointer(*))
# :fill_input_buffer ::
# (FFI::Pointer(*))
# :skip_input_data ::
# (FFI::Pointer(*))
# :resync_to_restart ::
# (FFI::Pointer(*))
# :term_source ::
# (FFI::Pointer(*))
class SourceMgr < FFI::Struct
layout :next_input_byte, :pointer,
:bytes_in_buffer, :int,
:init_source, :pointer,
:fill_input_buffer, :pointer,
:skip_input_data, :pointer,
:resync_to_restart, :pointer,
:term_source, :pointer
end
# lasts until done with image/datastream
class JvirtSarrayControl < FFI::Struct
layout :dummy, :char
end
# (Not documented)
class JvirtBarrayControl < FFI::Struct
layout :dummy, :char
end
# (Not documented)
#
# = Fields:
# :alloc_small ::
# (FFI::Pointer(*))
# :alloc_large ::
# (FFI::Pointer(*))
# :alloc_sarray ::
# (FFI::Pointer(*))
# :alloc_barray ::
# (FFI::Pointer(*))
# :request_virt_sarray ::
# (FFI::Pointer(*))
# :request_virt_barray ::
# (FFI::Pointer(*))
# :realize_virt_arrays ::
# (FFI::Pointer(*))
# :access_virt_sarray ::
# (FFI::Pointer(*))
# :access_virt_barray ::
# (FFI::Pointer(*))
# :free_pool ::
# (FFI::Pointer(*))
# :self_destruct ::
# (FFI::Pointer(*))
# :max_memory_to_use ::
# (Integer) Limit on memory allocation for this JPEG object. (Note that this is
# merely advisory, not a guaranteed maximum; it only affects the space
# used for virtual-array buffers.) May be changed by outer application
# after creating the JPEG object.
# :max_alloc_chunk ::
# (Integer) Maximum allocation request accepted by alloc_large.
class MemoryMgr < FFI::Struct
layout :alloc_small, :pointer,
:alloc_large, :pointer,
:alloc_sarray, :pointer,
:alloc_barray, :pointer,
:request_virt_sarray, :pointer,
:request_virt_barray, :pointer,
:realize_virt_arrays, :pointer,
:access_virt_sarray, :pointer,
:access_virt_barray, :pointer,
:free_pool, :pointer,
:self_destruct, :pointer,
:max_memory_to_use, :long,
:max_alloc_chunk, :long
end
# (Not documented)
#
# <em>This entry is only for documentation and no real method.</em>
#
# @method _callback_marker_parser_method_(cinfo)
# @param [DecompressStruct] cinfo
# @return [Integer]
# @scope class
callback :marker_parser_method, [DecompressStruct], :int
# Default error-management setup
#
# @method std_error(err)
# @param [ErrorMgr] err
# @return [ErrorMgr]
# @scope class
attach_function :std_error, :jpeg_std_error, [ErrorMgr], ErrorMgr
# Initialization of JPEG compression objects.
# jpeg_create_compress() and jpeg_create_decompress() are the exported
# names that applications should call. These expand to calls on
# jpeg_CreateCompress and jpeg_CreateDecompress with additional information
# passed for version mismatch checking.
# NB: you must set up the error-manager BEFORE calling jpeg_create_xxx.
#
# @method create_compress(cinfo, version, structsize)
# @param [CompressStruct] cinfo
# @param [Integer] version
# @param [Integer] structsize
# @return [nil]
# @scope class
attach_function :create_compress, :jpeg_CreateCompress, [CompressStruct, :int, :int], :void
# (Not documented)
#
# @method create_decompress(cinfo, version, structsize)
# @param [DecompressStruct] cinfo
# @param [Integer] version
# @param [Integer] structsize
# @return [nil]
# @scope class
attach_function :create_decompress, :jpeg_CreateDecompress, [DecompressStruct, :int, :int], :void
# Destruction of JPEG compression objects
#
# @method destroy_compress(cinfo)
# @param [CompressStruct] cinfo
# @return [nil]
# @scope class
attach_function :destroy_compress, :jpeg_destroy_compress, [CompressStruct], :void
# (Not documented)
#
# @method destroy_decompress(cinfo)
# @param [DecompressStruct] cinfo
# @return [nil]
# @scope class
attach_function :destroy_decompress, :jpeg_destroy_decompress, [DecompressStruct], :void
# Caller is responsible for opening the file before and closing after.
#
# @method stdio_dest(cinfo, outfile)
# @param [CompressStruct] cinfo
# @param [FFI::Pointer(*Int)] outfile
# @return [nil]
# @scope class
attach_function :stdio_dest, :jpeg_stdio_dest, [CompressStruct, :pointer], :void
# (Not documented)
#
# @method stdio_src(cinfo, infile)
# @param [DecompressStruct] cinfo
# @param [FFI::Pointer(*Int)] infile
# @return [nil]
# @scope class
attach_function :stdio_src, :jpeg_stdio_src, [DecompressStruct, :pointer], :void
# Data source and destination managers: memory buffers.
#
# @method mem_dest(cinfo, outbuffer, outsize)
# @param [CompressStruct] cinfo
# @param [FFI::Pointer(**UChar)] outbuffer
# @param [FFI::Pointer(*ULong)] outsize
# @return [nil]
# @scope class
attach_function :mem_dest, :jpeg_mem_dest, [CompressStruct, :pointer, :pointer], :void
# (Not documented)
#
# @method mem_src(cinfo, inbuffer, insize)
# @param [DecompressStruct] cinfo
# @param [FFI::Pointer(*UChar)] inbuffer
# @param [Integer] insize
# @return [nil]
# @scope class
attach_function :mem_src, :jpeg_mem_src, [DecompressStruct, :pointer, :ulong], :void
# Default parameter setup for compression
#
# @method set_defaults(cinfo)
# @param [CompressStruct] cinfo
# @return [nil]
# @scope class
attach_function :set_defaults, :jpeg_set_defaults, [CompressStruct], :void
# Compression parameter setup aids
#
# @method set_colorspace(cinfo, colorspace)
# @param [CompressStruct] cinfo
# @param [Symbol from _enum_j_color_space_] colorspace
# @return [nil]
# @scope class
attach_function :set_colorspace, :jpeg_set_colorspace, [CompressStruct, :j_color_space], :void
# (Not documented)
#
# @method default_colorspace(cinfo)
# @param [CompressStruct] cinfo
# @return [nil]
# @scope class
attach_function :default_colorspace, :jpeg_default_colorspace, [CompressStruct], :void
# (Not documented)
#
# @method set_quality(cinfo, quality, force_baseline)
# @param [CompressStruct] cinfo
# @param [Integer] quality
# @param [Integer] force_baseline
# @return [nil]
# @scope class
attach_function :set_quality, :jpeg_set_quality, [CompressStruct, :int, :int], :void
# (Not documented)
#
# @method set_linear_quality(cinfo, scale_factor, force_baseline)
# @param [CompressStruct] cinfo
# @param [Integer] scale_factor
# @param [Integer] force_baseline
# @return [nil]
# @scope class
attach_function :set_linear_quality, :jpeg_set_linear_quality, [CompressStruct, :int, :int], :void
# (Not documented)
#
# @method default_qtables(cinfo, force_baseline)
# @param [CompressStruct] cinfo
# @param [Integer] force_baseline
# @return [nil]
# @scope class
attach_function :default_qtables, :jpeg_default_qtables, [CompressStruct, :int], :void
# (Not documented)
#
# @method add_quant_table(cinfo, which_tbl, basic_table, scale_factor, force_baseline)
# @param [CompressStruct] cinfo
# @param [Integer] which_tbl
# @param [FFI::Pointer(*UInt)] basic_table
# @param [Integer] scale_factor
# @param [Integer] force_baseline
# @return [nil]
# @scope class
attach_function :add_quant_table, :jpeg_add_quant_table, [CompressStruct, :int, :pointer, :int, :int], :void
# (Not documented)
#
# @method quality_scaling(quality)
# @param [Integer] quality
# @return [Integer]
# @scope class
attach_function :quality_scaling, :jpeg_quality_scaling, [:int], :int
# (Not documented)
#
# @method simple_progression(cinfo)
# @param [CompressStruct] cinfo
# @return [nil]
# @scope class
attach_function :simple_progression, :jpeg_simple_progression, [CompressStruct], :void
# (Not documented)
#
# @method suppress_tables(cinfo, suppress)
# @param [CompressStruct] cinfo
# @param [Integer] suppress
# @return [nil]
# @scope class
attach_function :suppress_tables, :jpeg_suppress_tables, [CompressStruct, :int], :void
# (Not documented)
#
# @method alloc_quant_table(cinfo)
# @param [CommonStruct] cinfo
# @return [JQUANTTBL]
# @scope class
attach_function :alloc_quant_table, :jpeg_alloc_quant_table, [CommonStruct], JQUANTTBL
# (Not documented)
#
# @method alloc_huff_table(cinfo)
# @param [CommonStruct] cinfo
# @return [JHUFFTBL]
# @scope class
attach_function :alloc_huff_table, :jpeg_alloc_huff_table, [CommonStruct], JHUFFTBL
# Main entry points for compression
#
# @method start_compress(cinfo, write_all_tables)
# @param [CompressStruct] cinfo
# @param [Integer] write_all_tables
# @return [nil]
# @scope class
attach_function :start_compress, :jpeg_start_compress, [CompressStruct, :int], :void
# (Not documented)
#
# @method write_scanlines(cinfo, scanlines, num_lines)
# @param [CompressStruct] cinfo
# @param [FFI::Pointer(JSAMPARRAY)] scanlines
# @param [Integer] num_lines
# @return [Integer]
# @scope class
attach_function :write_scanlines, :jpeg_write_scanlines, [CompressStruct, :pointer, :uint], :uint
# (Not documented)
#
# @method finish_compress(cinfo)
# @param [CompressStruct] cinfo
# @return [nil]
# @scope class
attach_function :finish_compress, :jpeg_finish_compress, [CompressStruct], :void
# Precalculate JPEG dimensions for current compression parameters.
#
# @method calc_jpeg_dimensions(cinfo)
# @param [CompressStruct] cinfo
# @return [nil]
# @scope class
attach_function :calc_jpeg_dimensions, :jpeg_calc_jpeg_dimensions, [CompressStruct], :void
# Replaces jpeg_write_scanlines when writing raw downsampled data.
#
# @method write_raw_data(cinfo, data, num_lines)
# @param [CompressStruct] cinfo
# @param [FFI::Pointer(JSAMPIMAGE)] data
# @param [Integer] num_lines
# @return [Integer]
# @scope class
attach_function :write_raw_data, :jpeg_write_raw_data, [CompressStruct, :pointer, :uint], :uint
# Write a special marker. See libjpeg.txt concerning safe usage.
#
# @method write_marker(cinfo, marker, dataptr, datalen)
# @param [CompressStruct] cinfo
# @param [Integer] marker
# @param [FFI::Pointer(*JOCTET)] dataptr
# @param [Integer] datalen
# @return [nil]
# @scope class
attach_function :write_marker, :jpeg_write_marker, [CompressStruct, :int, :pointer, :uint], :void
# Same, but piecemeal.
#
# @method write_m_header(cinfo, marker, datalen)
# @param [CompressStruct] cinfo
# @param [Integer] marker
# @param [Integer] datalen
# @return [nil]
# @scope class
attach_function :write_m_header, :jpeg_write_m_header, [CompressStruct, :int, :uint], :void
# (Not documented)
#
# @method write_m_byte(cinfo, val)
# @param [CompressStruct] cinfo
# @param [Integer] val
# @return [nil]
# @scope class
attach_function :write_m_byte, :jpeg_write_m_byte, [CompressStruct, :int], :void
# Alternate compression function: just write an abbreviated table file
#
# @method write_tables(cinfo)
# @param [CompressStruct] cinfo
# @return [nil]
# @scope class
attach_function :write_tables, :jpeg_write_tables, [CompressStruct], :void
# Decompression startup: read start of JPEG datastream to see what's there
#
# @method read_header(cinfo, require_image)
# @param [DecompressStruct] cinfo
# @param [Integer] require_image
# @return [Integer]
# @scope class
attach_function :read_header, :jpeg_read_header, [DecompressStruct, :int], :int
# Main entry points for decompression
#
# @method start_decompress(cinfo)
# @param [DecompressStruct] cinfo
# @return [Integer]
# @scope class
attach_function :start_decompress, :jpeg_start_decompress, [DecompressStruct], :int
# (Not documented)
#
# @method read_scanlines(cinfo, scanlines, max_lines)
# @param [DecompressStruct] cinfo
# @param [FFI::Pointer(JSAMPARRAY)] scanlines
# @param [Integer] max_lines
# @return [Integer]
# @scope class
attach_function :read_scanlines, :jpeg_read_scanlines, [DecompressStruct, :pointer, :uint], :uint
# (Not documented)
#
# @method finish_decompress(cinfo)
# @param [DecompressStruct] cinfo
# @return [Integer]
# @scope class
attach_function :finish_decompress, :jpeg_finish_decompress, [DecompressStruct], :int
# Replaces jpeg_read_scanlines when reading raw downsampled data.
#
# @method read_raw_data(cinfo, data, max_lines)
# @param [DecompressStruct] cinfo
# @param [FFI::Pointer(JSAMPIMAGE)] data
# @param [Integer] max_lines
# @return [Integer]
# @scope class
attach_function :read_raw_data, :jpeg_read_raw_data, [DecompressStruct, :pointer, :uint], :uint
# Additional entry points for buffered-image mode.
#
# @method has_multiple_scans(cinfo)
# @param [DecompressStruct] cinfo
# @return [Integer]
# @scope class
attach_function :has_multiple_scans, :jpeg_has_multiple_scans, [DecompressStruct], :int
# (Not documented)
#
# @method start_output(cinfo, scan_number)
# @param [DecompressStruct] cinfo
# @param [Integer] scan_number
# @return [Integer]
# @scope class
attach_function :start_output, :jpeg_start_output, [DecompressStruct, :int], :int
# (Not documented)
#
# @method finish_output(cinfo)
# @param [DecompressStruct] cinfo
# @return [Integer]
# @scope class
attach_function :finish_output, :jpeg_finish_output, [DecompressStruct], :int
# (Not documented)
#
# @method input_complete(cinfo)
# @param [DecompressStruct] cinfo
# @return [Integer]
# @scope class
attach_function :input_complete, :jpeg_input_complete, [DecompressStruct], :int
# (Not documented)
#
# @method new_colormap(cinfo)
# @param [DecompressStruct] cinfo
# @return [nil]
# @scope class
attach_function :new_colormap, :jpeg_new_colormap, [DecompressStruct], :void
# (Not documented)
#
# @method consume_input(cinfo)
# @param [DecompressStruct] cinfo
# @return [Integer]
# @scope class
attach_function :consume_input, :jpeg_consume_input, [DecompressStruct], :int
# Precalculate output dimensions for current decompression parameters.
#
# @method core_output_dimensions(cinfo)
# @param [DecompressStruct] cinfo
# @return [nil]
# @scope class
attach_function :core_output_dimensions, :jpeg_core_output_dimensions, [DecompressStruct], :void
# (Not documented)
#
# @method calc_output_dimensions(cinfo)
# @param [DecompressStruct] cinfo
# @return [nil]
# @scope class
attach_function :calc_output_dimensions, :jpeg_calc_output_dimensions, [DecompressStruct], :void
# Control saving of COM and APPn markers into marker_list.
#
# @method save_markers(cinfo, marker_code, length_limit)
# @param [DecompressStruct] cinfo
# @param [Integer] marker_code
# @param [Integer] length_limit
# @return [nil]
# @scope class
attach_function :save_markers, :jpeg_save_markers, [DecompressStruct, :int, :uint], :void
# Install a special processing method for COM or APPn markers.
#
# @method set_marker_processor(cinfo, marker_code, routine)
# @param [DecompressStruct] cinfo
# @param [Integer] marker_code
# @param [Proc(_callback_marker_parser_method_)] routine
# @return [nil]
# @scope class
attach_function :set_marker_processor, :jpeg_set_marker_processor, [DecompressStruct, :int, :marker_parser_method], :void
# Read or write raw DCT coefficients --- useful for lossless transcoding.
#
# @method read_coefficients(cinfo)
# @param [DecompressStruct] cinfo
# @return [FFI::Pointer(*JvirtBarrayPtr)]
# @scope class
attach_function :read_coefficients, :jpeg_read_coefficients, [DecompressStruct], :pointer
# (Not documented)
#
# @method write_coefficients(cinfo, coef_arrays)
# @param [CompressStruct] cinfo
# @param [FFI::Pointer(*JvirtBarrayPtr)] coef_arrays
# @return [nil]
# @scope class
attach_function :write_coefficients, :jpeg_write_coefficients, [CompressStruct, :pointer], :void
# (Not documented)
#
# @method copy_critical_parameters(srcinfo, dstinfo)
# @param [DecompressStruct] srcinfo
# @param [CompressStruct] dstinfo
# @return [nil]
# @scope class
attach_function :copy_critical_parameters, :jpeg_copy_critical_parameters, [DecompressStruct, CompressStruct], :void
# If you choose to abort compression or decompression before completing
# jpeg_finish_(de)compress, then you need to clean up to release memory,
# temporary files, etc. You can just call jpeg_destroy_(de)compress
# if you're done with the JPEG object, but if you want to clean it up and
# reuse it, call this:
#
# @method abort_compress(cinfo)
# @param [CompressStruct] cinfo
# @return [nil]
# @scope class
attach_function :abort_compress, :jpeg_abort_compress, [CompressStruct], :void
# (Not documented)
#
# @method abort_decompress(cinfo)
# @param [DecompressStruct] cinfo
# @return [nil]
# @scope class
attach_function :abort_decompress, :jpeg_abort_decompress, [DecompressStruct], :void
# Generic versions of jpeg_abort and jpeg_destroy that work on either
# flavor of JPEG object. These may be more convenient in some places.
#
# @method abort(cinfo)
# @param [CommonStruct] cinfo
# @return [nil]
# @scope class
attach_function :abort, :jpeg_abort, [CommonStruct], :void
# (Not documented)
#
# @method destroy(cinfo)
# @param [CommonStruct] cinfo
# @return [nil]
# @scope class
attach_function :destroy, :jpeg_destroy, [CommonStruct], :void
# Default restart-marker-resync procedure for use by data source modules
#
# @method resync_to_restart(cinfo, desired)
# @param [DecompressStruct] cinfo
# @param [Integer] desired
# @return [Integer]
# @scope class
attach_function :resync_to_restart, :jpeg_resync_to_restart, [DecompressStruct, :int], :int
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment