diff --git a/src/aztec/aztec_reader.rs b/src/aztec/aztec_reader.rs index 8ace9b5..8a1f818 100644 --- a/src/aztec/aztec_reader.rs +++ b/src/aztec/aztec_reader.rs @@ -40,11 +40,12 @@ impl Reader for AztecReader { * @throws NotFoundException if a Data Matrix code cannot be found * @throws FormatException if a Data Matrix code cannot be decoded */ - fn decode(image: &BinaryBitmap) -> Result { - Self::decode_with_hints(image, &HashMap::new()) + fn decode(&self,image: &BinaryBitmap) -> Result { + self.decode_with_hints(image, &HashMap::new()) } fn decode_with_hints( + &self, image: &BinaryBitmap, hints: &HashMap, ) -> Result { @@ -54,6 +55,7 @@ impl Reader for AztecReader { let mut points; let mut decoderRXingResult: DecoderRXingResult; // try { + let detectorRXingResult = detector.detect(false)?; points = detectorRXingResult.getPoints(); @@ -117,7 +119,7 @@ impl Reader for AztecReader { Ok(result) } - fn reset() { + fn reset(&self) { // do nothing } } diff --git a/src/aztec/aztec_writer.rs b/src/aztec/aztec_writer.rs index cbbdd1d..788ddf3 100644 --- a/src/aztec/aztec_writer.rs +++ b/src/aztec/aztec_writer.rs @@ -32,15 +32,17 @@ pub struct AztecWriter; impl Writer for AztecWriter { fn encode( + &self, contents: &str, format: &crate::BarcodeFormat, width: i32, height: i32, ) -> Result { - Self::encode_with_hints(contents, format, width, height, &HashMap::new()) + self.encode_with_hints(contents, format, width, height, &HashMap::new()) } fn encode_with_hints( + &self, contents: &str, format: &crate::BarcodeFormat, width: i32,