[][src]Crate zbar_rust

High-level and low-level ZBar binding for the Rust language.

Compilation

To compile this crate, you need to compile the ZBar library first. You can install ZBar in your operating system, or in somewhere in your file system. As for the latter, you need to set the following environment variables to link the ZBar library:

  • ZBAR_LIB_DIRS: The directories of library files, like -L. Use : to separate.
  • ZBAR_LIBS: The library names that you want to link, like -l. Use : to separate. Typically, it is iconv:zbar.
  • ZBAR_INCLUDE_DIRS: The directories of header files, like -i. Use : to separate.

Examples

This example is not tested
extern crate zbar_rust;
extern crate image;

use zbar_rust::ZBarImageScanner;

use image::GenericImageView;

let img = image::open(INPUT_IMAGE_PATH).unwrap();

let (width, height) = img.dimensions();

let luma_img = img.to_luma();

let luma_img_data: Vec<u8> = luma_img.to_vec();

let mut scanner = ZBarImageScanner::new();

let results = scanner.scan_y800(&luma_img_data, width, height).unwrap();

for result in results {
    println!("{}", String::from_utf8(result.data).unwrap())
}

More examples are in the examples folder.

Structs

ZBarImage
ZBarImageScanResult
ZBarImageScanner

Enums

VideoControlType
ZBarColor
ZBarConfig
ZBarError
ZBarModifier
ZBarOrientation
ZBarSymbolType

Functions

zbar_image_convert
zbar_image_convert_resize
zbar_image_create
zbar_image_destroy
zbar_image_first_symbol
zbar_image_free_data
zbar_image_get_crop
zbar_image_get_data
zbar_image_get_data_length
zbar_image_get_format
zbar_image_get_height
zbar_image_get_sequence
zbar_image_get_size
zbar_image_get_symbols
zbar_image_get_userdata
zbar_image_get_width
zbar_image_read
zbar_image_ref
zbar_image_scanner_create
zbar_image_scanner_destroy
zbar_image_scanner_enable_cache
zbar_image_scanner_get_results
zbar_image_scanner_parse_config
zbar_image_scanner_recycle_image
zbar_image_scanner_set_config
zbar_image_scanner_set_data_handler
zbar_image_set_crop
zbar_image_set_data
zbar_image_set_format
zbar_image_set_sequence
zbar_image_set_size
zbar_image_set_symbols
zbar_image_set_userdata
zbar_image_write
zbar_scan_image
zbar_set_verbosity
zbar_symbol_first_component
zbar_symbol_get_components
zbar_symbol_get_configs
zbar_symbol_get_count
zbar_symbol_get_data
zbar_symbol_get_data_length
zbar_symbol_get_loc_size
zbar_symbol_get_loc_x
zbar_symbol_get_loc_y
zbar_symbol_get_modifiers
zbar_symbol_get_orientation
zbar_symbol_get_quality
zbar_symbol_get_type
zbar_symbol_next
zbar_symbol_ref
zbar_symbol_xml
zbar_version