wip: add dxo edge barcode (inop)

This commit is contained in:
Henry Schimke
2024-01-16 12:25:44 -06:00
parent 12eedd1672
commit 5892f92e72
8 changed files with 1055 additions and 2 deletions

View File

@@ -47,6 +47,10 @@ impl PatternRow {
pub fn into_pattern_view(&self) -> PatternView {
PatternView::new(self)
}
pub fn sum(&self) -> PatternType {
self.0.iter().sum()
}
}
impl IntoIterator for PatternRow {
@@ -363,12 +367,16 @@ impl<'a> From<&PatternView<'a>> for &'a [PatternType] {
*
* The operator[](int) can be used in combination with a PatternView
*/
#[derive(Default)]
struct BarAndSpace<T: Default + std::cmp::PartialEq> {
#[derive(Default, Clone)]
pub struct BarAndSpace<T: Default + std::cmp::PartialEq> {
bar: T,
space: T,
}
impl<T: Default + std::cmp::PartialEq> BarAndSpace<T> {
pub fn new(bar: T, space: T) -> BarAndSpace<T> {
Self { bar, space }
}
#[allow(dead_code)]
pub fn isValid(&self) -> bool {
self.bar != T::default() && self.space != T::default()