1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
//! # QR Code Generator Library
//!
//! This library provides functionality to create QR codes with different error correction levels.
//!
//! ## Modules
//!
//! - `bit_utils`: Utility functions for bit manipulation.
//! - `galios`: Functions for Galois field arithmetic.
//! - `qr_code`: Core QR code generation logic.
//!
//! ## Functions
//!
//! ### `create_qr_code`
//!
//! ```rust
//! pub fn create_qr_code(data: &str, error_correction_level: ErrorCorrectionLevel) -> BitMap
//! ```
//!
//! Creates a QR code from the given data and error correction level.
//!
//! #### Parameters
//!
//! - `data`: A string slice that holds the data to be encoded in the QR code.
//! - `error_correction_level`: The desired level of error correction for the QR code.
//!
//! #### Returns
//!
//! A `BitMap` representing the generated QR code.
//!
//! ## Examples
//!
//! ```rust
//! use qr_code::*;
//!
//! let qr_code = create_qr_code("HELLO, WORLD!", ErrorCorrectionLevel::Q);
//! println!("{}", qr_code);
//! ```
pub use BitMap;
pub use ErrorCorrectionLevel;
use QRMode;
/// Creates a QR code bitmap from input data with specified error correction
///
/// This function generates a complete QR code bitmap by performing the following steps:
/// 1. Analyze the input data to determine the appropriate encoding mode
/// 2. Encode the data into a bitstring
/// 3. Generate error correction codes
/// 4. Structure the data and error correction codewords
/// 5. Create the final QR code bitmap
///
/// # Arguments
///
/// * `data` - The string data to be encoded in the QR code
/// * `error_correction_level` - The error correction level for redundancy and recovery
///
/// # Returns
///
/// A `BitMap` representing the fully generated QR code
///
/// # Errors
///
/// Panics if the data cannot be encoded or exceeds QR code capacity
///
/// # Examples
///
/// ```
/// use qr_code::{create_qr_code, ErrorCorrectionLevel};
///
/// let qr_code = create_qr_code("HELLO, WORLD!", ErrorCorrectionLevel::Q);
/// ```
///
/// # Performance
///
/// The function's complexity depends on the data length and chosen error correction level