port pdf 417 writer

This commit is contained in:
Henry Schimke
2022-12-26 13:29:57 -06:00
parent 0061fdd900
commit 07e8aa2971
6 changed files with 300 additions and 177 deletions

View File

@@ -16,6 +16,8 @@
//package com.google.zxing;
use std::fmt::Display;
/**
* Enumerates barcode formats known to this package. Please keep alphabetized.
*
@@ -74,3 +76,31 @@ pub enum BarcodeFormat {
/** UPC/EAN extension format. Not a stand-alone format. */
UPC_EAN_EXTENSION,
}
impl Display for BarcodeFormat {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(
f,
"{}",
match self {
BarcodeFormat::AZTEC => "aztec",
BarcodeFormat::CODABAR => "codabar",
BarcodeFormat::CODE_39 => "code 39",
BarcodeFormat::CODE_93 => "code 93",
BarcodeFormat::CODE_128 => "code 128",
BarcodeFormat::DATA_MATRIX => "datamatrix",
BarcodeFormat::EAN_8 => "ean 8",
BarcodeFormat::EAN_13 => "ean 13",
BarcodeFormat::ITF => "itf",
BarcodeFormat::MAXICODE => "maxicode",
BarcodeFormat::PDF_417 => "pdf 417",
BarcodeFormat::QR_CODE => "qrcode",
BarcodeFormat::RSS_14 => "rss 14",
BarcodeFormat::RSS_EXPANDED => "rss expanded",
BarcodeFormat::UPC_A => "upc a",
BarcodeFormat::UPC_E => "upc e",
BarcodeFormat::UPC_EAN_EXTENSION => "upc/ean extension",
}
)
}
}