Struct lodepng::ffi::CompressSettings [] [src]

pub struct CompressSettings {
    pub btype: c_uint,
    pub use_lz77: c_uint,
    pub windowsize: c_uint,
    pub minmatch: c_uint,
    pub nicematch: c_uint,
    pub lazymatching: c_uint,
    pub custom_zlib: Option<extern fn(arg1: *mut *mut c_uchar, arg2: *mut size_t, arg3: *const c_uchar, arg4: size_t, arg5: *const CompressSettings) -> c_uint>,
    pub custom_deflate: Option<extern fn(arg1: *mut *mut c_uchar, arg2: *mut size_t, arg3: *const c_uchar, arg4: size_t, arg5: *const CompressSettings) -> c_uint>,
    pub custom_context: *const c_void,
}

Settings for zlib compression. Tweaking these settings tweaks the balance between speed and compression ratio.

Fields

btype: c_uint

the block type for LZ (0, 1, 2 or 3, see zlib standard). Should be 2 for proper compression.

use_lz77: c_uint

whether or not to use LZ77. Should be 1 for proper compression.

windowsize: c_uint

must be a power of two <= 32768. higher compresses more but is slower. Typical value: 2048.

minmatch: c_uint

mininum lz77 length. 3 is normally best, 6 can be better for some PNGs. Default: 0

nicematch: c_uint

stop searching if >= this length found. Set to 258 for best compression. Default: 128

lazymatching: c_uint

use lazy matching: better compression but a bit slower. Default: true

custom_zlib: Option<extern fn(arg1: *mut *mut c_uchar, arg2: *mut size_t, arg3: *const c_uchar, arg4: size_t, arg5: *const CompressSettings) -> c_uint>

use custom zlib encoder instead of built in one (default: None)

custom_deflate: Option<extern fn(arg1: *mut *mut c_uchar, arg2: *mut size_t, arg3: *const c_uchar, arg4: size_t, arg5: *const CompressSettings) -> c_uint>

use custom deflate encoder instead of built in one (default: null) if custom_zlib is used, custom_deflate is ignored since only the built in zlib function will call custom_deflate

custom_context: *const c_void

optional custom settings for custom functions

Methods

impl CompressSettings
[src]

fn new() -> CompressSettings

Default compression settings