Skip to content

Commit

Permalink
wip: immutable reader stubs in experimental
Browse files Browse the repository at this point in the history
  • Loading branch information
hschimke committed Jul 31, 2024
1 parent b2ecb23 commit 4c33d2d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
* limitations under the License.
*/

//package com.google.zxing;

use std::collections::HashMap;

use crate::{common::Result, Binarizer, BinaryBitmap, DecodingHintDictionary, RXingResult};

/**
Expand Down Expand Up @@ -70,9 +66,12 @@ pub trait Reader {
*/
fn reset(&mut self) { /* do nothing */
}
}

#[cfg( feature = "experimental_features")]
pub trait ImmutableReader {
fn immutable_decode<B: Binarizer>(&self, image: &mut BinaryBitmap<B>) -> Result<RXingResult> {
self.immutable_decode_with_hints(image, &HashMap::default())
self.immutable_decode_with_hints(image, &DecodingHintDictionary::default())
}

fn immutable_decode_with_hints<B: Binarizer>(
Expand All @@ -82,4 +81,4 @@ pub trait Reader {
) -> Result<RXingResult> {
unimplemented!()
}
}
}

0 comments on commit 4c33d2d

Please sign in to comment.