Module svg

Module svg 

Source
Expand description

Functionality for generating SVG representations of barcodes.

An SVG can be constructed via the standard constructor pattern or via a constructor method if you want default values.

For example:

use scanning::generators::svg::*;

// Specify your own struct fields.
let svg = SVG{height: 80,
              xdim: 1,
              background: Color{rgba: [255, 0, 0, 255]},
              foreground: Color::black(),
              xmlns: Some(String::from("http://www.w3.org/2000/svg"))};

// Or use the constructor for defaults (you must specify the height).
let svg = SVG::new(100)
              .xdim(2)
              .background(Color::white())
              .foreground(Color::black())
              .xmlns(String::from("http://www.w3.org/2000/svg"));

Structsยง

Color
Represents a RGBA color for the barcode foreground and background.
SVG
The SVG barcode generator type.