#[cfg(test)]
mod GenericGFPolyTestCase;
#[cfg(test)]
pub(crate) mod ReedSolomonTestCase;
pub type GenericGFRef = &'static GenericGF;
const AZTEC_DATA_12: GenericGF = GenericGF::new(0x1069, 4096, 1); const AZTEC_DATA_10: GenericGF = GenericGF::new(0x409, 1024, 1); const AZTEC_DATA_6: GenericGF = GenericGF::new(0x43, 64, 1); const AZTEC_PARAM: GenericGF = GenericGF::new(0x13, 16, 1); const QR_CODE_FIELD_256: GenericGF = GenericGF::new(0x011D, 256, 0); const DATA_MATRIX_FIELD_256: GenericGF = GenericGF::new(0x012D, 256, 1);
pub enum PredefinedGenericGF {
AztecData12,
AztecData10,
AztecData6,
AztecParam,
QrCodeField256,
DataMatrixField256,
AztecData8,
MaxicodeField64,
}
impl From<PredefinedGenericGF> for GenericGFRef {
fn from(value: PredefinedGenericGF) -> Self {
match value {
PredefinedGenericGF::AztecData12 => &AZTEC_DATA_12, PredefinedGenericGF::AztecData10 => &AZTEC_DATA_10, PredefinedGenericGF::AztecData6 | PredefinedGenericGF::MaxicodeField64 => &AZTEC_DATA_6, PredefinedGenericGF::AztecParam => &AZTEC_PARAM, PredefinedGenericGF::QrCodeField256 => &QR_CODE_FIELD_256, PredefinedGenericGF::DataMatrixField256 | PredefinedGenericGF::AztecData8 => {
&DATA_MATRIX_FIELD_256
} }
}
}
mod generic_gf;
pub use generic_gf::*;
mod generic_gf_poly;
pub use generic_gf_poly::*;
mod reedsolomon_decoder;
pub use reedsolomon_decoder::*;
mod reedsolomon_encoder;
pub use reedsolomon_encoder::*;