From 8481cb4542877e6b08842f264d4827ef88ce8154 Mon Sep 17 00:00:00 2001 From: Henry Schimke Date: Wed, 4 Jan 2023 16:50:14 -0600 Subject: [PATCH] add stubs for luma only helpers --- src/helpers.rs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/helpers.rs b/src/helpers.rs index f03517a..81e72ae 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -11,6 +11,7 @@ use crate::{ DecodingHintDictionary, Exceptions, MultiFormatReader, RXingResult, Reader, }; +#[cfg(feature = "image")] pub fn detect_in_file( file_name: &str, barcode_type: Option, @@ -18,6 +19,7 @@ pub fn detect_in_file( detect_in_file_with_hints(file_name, barcode_type, &mut HashMap::new()) } +#[cfg(feature = "image")] pub fn detect_in_file_with_hints( file_name: &str, barcode_type: Option, @@ -45,10 +47,12 @@ pub fn detect_in_file_with_hints( ) } +#[cfg(feature = "image")] pub fn detect_multiple_in_file(file_name: &str) -> Result, Exceptions> { detect_multiple_in_file_with_hints(file_name, &mut HashMap::new()) } +#[cfg(feature = "image")] pub fn detect_multiple_in_file_with_hints( file_name: &str, hints: &mut DecodingHintDictionary, @@ -68,3 +72,29 @@ pub fn detect_multiple_in_file_with_hints( &hints, ) } + +pub fn detect_in_luma( + luma: &[u8], + barcode_type: Option, +) -> Result { + detect_in_luma_with_hints(luma, barcode_type, &mut HashMap::new()) +} + +pub fn detect_in_luma_with_hints( + luma: &[u8], + barcode_type: Option, + hints: &mut DecodingHintDictionary, +) -> Result { + Err(Exceptions::NotFoundException(None)) +} + +pub fn detect_multiple_in_luma(luma: &[u8]) -> Result, Exceptions> { + detect_multiple_in_luma_with_hints(luma, &mut HashMap::new()) +} + +pub fn detect_multiple_in_luma_with_hints( + file_name: &[u8], + hints: &mut DecodingHintDictionary, +) -> Result, Exceptions> { + Err(Exceptions::NotFoundException(None)) +}