wip: Search & replace RXingResultPoint with Point

Build fails because the OneDReader proc macro expects
that a RXingResultPoint type exists.
This commit is contained in:
Vukašin Stepanović
2023-02-16 08:25:32 +00:00
parent 15280d5f98
commit dbc6ca4e55
57 changed files with 476 additions and 476 deletions

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
use crate::RXingResultPoint;
use crate::Point;
/**
* Meta-data container for QR Code decoding. Instances of this class may be used to convey information back to the
@@ -41,7 +41,7 @@ impl QRCodeDecoderMetaData {
*
* @param points Array of points to apply mirror correction to.
*/
pub fn applyMirroredCorrection(&self, points: &mut [RXingResultPoint]) {
pub fn applyMirroredCorrection(&self, points: &mut [Point]) {
if !self.0 || points.is_empty() || points.len() < 3 {
return;
}

View File

@@ -14,9 +14,9 @@
* limitations under the License.
*/
//RXingResultPoint
//Point
use crate::{RXingResultPoint, ResultPoint};
use crate::{Point, ResultPoint};
/**
* <p>Encapsulates an alignment pattern, which are the smaller square patterns found in
@@ -39,8 +39,8 @@ impl ResultPoint for AlignmentPattern {
self.point.1
}
fn into_rxing_result_point(self) -> RXingResultPoint {
RXingResultPoint {
fn into_rxing_result_point(self) -> Point {
Point {
x: self.point.0,
y: self.point.1,
}

View File

@@ -16,7 +16,7 @@
use crate::{
common::{BitMatrix, Result},
Exceptions, RXingResultPointCallback,
Exceptions, PointCallback,
};
use super::AlignmentPattern;
@@ -44,7 +44,7 @@ pub struct AlignmentPatternFinder {
height: u32,
moduleSize: f32,
crossCheckStateCount: [u32; 3],
resultPointCallback: Option<RXingResultPointCallback>,
resultPointCallback: Option<PointCallback>,
}
impl AlignmentPatternFinder {
@@ -65,7 +65,7 @@ impl AlignmentPatternFinder {
width: u32,
height: u32,
moduleSize: f32,
resultPointCallback: Option<RXingResultPointCallback>,
resultPointCallback: Option<PointCallback>,
) -> Self {
Self {
image,

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
use crate::{RXingResultPoint, ResultPoint};
use crate::{Point, ResultPoint};
/**
* <p>Encapsulates a finder pattern, which are the three square patterns found in
@@ -39,8 +39,8 @@ impl ResultPoint for FinderPattern {
self.point.1
}
fn into_rxing_result_point(self) -> RXingResultPoint {
RXingResultPoint {
fn into_rxing_result_point(self) -> Point {
Point {
x: self.point.0,
y: self.point.1,
}

View File

@@ -17,7 +17,7 @@
use crate::{
common::{BitMatrix, Result},
result_point_utils, DecodeHintType, DecodeHintValue, DecodingHintDictionary, Exceptions,
RXingResultPointCallback, ResultPoint,
PointCallback, ResultPoint,
};
use super::{FinderPattern, FinderPatternInfo};
@@ -35,7 +35,7 @@ pub struct FinderPatternFinder<'a> {
possibleCenters: Vec<FinderPattern>,
hasSkipped: bool,
crossCheckStateCount: [u32; 5],
resultPointCallback: Option<RXingResultPointCallback>,
resultPointCallback: Option<PointCallback>,
}
impl<'a> FinderPatternFinder<'_> {
pub const CENTER_QUORUM: usize = 2;
@@ -53,7 +53,7 @@ impl<'a> FinderPatternFinder<'_> {
pub fn with_callback(
image: &'a BitMatrix,
resultPointCallback: Option<RXingResultPointCallback>,
resultPointCallback: Option<PointCallback>,
) -> FinderPatternFinder<'a> {
FinderPatternFinder {
image,

View File

@@ -23,7 +23,7 @@ use crate::{
},
qrcode::decoder::Version,
result_point_utils, DecodeHintType, DecodeHintValue, DecodingHintDictionary, Exceptions,
RXingResultPointCallback, ResultPoint,
PointCallback, ResultPoint,
};
use super::{
@@ -39,7 +39,7 @@ use super::{
*/
pub struct Detector<'a> {
image: &'a BitMatrix,
resultPointCallback: Option<RXingResultPointCallback>,
resultPointCallback: Option<PointCallback>,
}
impl<'a> Detector<'_> {
@@ -54,7 +54,7 @@ impl<'a> Detector<'_> {
self.image
}
pub fn getRXingResultPointCallback(&self) -> &Option<RXingResultPointCallback> {
pub fn getPointCallback(&self) -> &Option<PointCallback> {
&self.resultPointCallback
}

View File

@@ -1,15 +1,15 @@
use crate::{
common::{BitMatrix, DetectorRXingResult},
RXingResultPoint,
Point,
};
pub struct QRCodeDetectorResult {
bit_source: BitMatrix,
result_points: Vec<RXingResultPoint>,
result_points: Vec<Point>,
}
impl QRCodeDetectorResult {
pub fn new(bit_source: BitMatrix, result_points: Vec<RXingResultPoint>) -> Self {
pub fn new(bit_source: BitMatrix, result_points: Vec<Point>) -> Self {
Self {
bit_source,
result_points,
@@ -22,7 +22,7 @@ impl DetectorRXingResult for QRCodeDetectorResult {
&self.bit_source
}
fn getPoints(&self) -> &[crate::RXingResultPoint] {
fn getPoints(&self) -> &[crate::Point] {
&self.result_points
}
}

View File

@@ -19,7 +19,7 @@ use std::collections::HashMap;
use crate::{
common::{BitMatrix, DecoderRXingResult, DetectorRXingResult, Result},
BarcodeFormat, DecodeHintType, DecodeHintValue, Exceptions, RXingResult,
RXingResultMetadataType, RXingResultMetadataValue, RXingResultPoint, Reader,
RXingResultMetadataType, RXingResultMetadataValue, Point, Reader,
};
use super::{
@@ -36,7 +36,7 @@ use super::{
pub struct QRCodeReader;
// pub struct QRCodeReader; {
// // private static final RXingResultPoint[] NO_POINTS = new RXingResultPoint[0];
// // private static final Point[] NO_POINTS = new Point[0];
// }
impl Reader for QRCodeReader {
@@ -58,7 +58,7 @@ impl Reader for QRCodeReader {
hints: &crate::DecodingHintDictionary,
) -> Result<crate::RXingResult> {
let decoderRXingResult: DecoderRXingResult;
let mut points: Vec<RXingResultPoint>;
let mut points: Vec<Point>;
if matches!(
hints.get(&DecodeHintType::PURE_BARCODE),
Some(DecodeHintValue::PureBarcode(true))