mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 20:32:34 +00:00
wip: Search & replace RXingResultPoint with Point
Build fails because the OneDReader proc macro expects that a RXingResultPoint type exists.
This commit is contained in:
@@ -215,8 +215,8 @@ impl Reader for RSSExpandedReader {
|
||||
// Update result points
|
||||
let height = rotatedImage.getHeight();
|
||||
|
||||
let total_points = result.getRXingResultPoints().len();
|
||||
let points = result.getRXingResultPointsMut();
|
||||
let total_points = result.getPoints().len();
|
||||
let points = result.getPointsMut();
|
||||
for point in points.iter_mut().take(total_points) {
|
||||
std::mem::swap(&mut point.x, &mut point.y);
|
||||
point.x = height as f32 - point.x - 1.0;
|
||||
@@ -545,14 +545,14 @@ impl RSSExpandedReader {
|
||||
.getFinderPattern()
|
||||
.as_ref()
|
||||
.ok_or(Exceptions::IllegalStateException(None))?
|
||||
.getRXingResultPoints();
|
||||
.getPoints();
|
||||
let lastPoints = pairs
|
||||
.last()
|
||||
.ok_or(Exceptions::IndexOutOfBoundsException(None))?
|
||||
.getFinderPattern()
|
||||
.as_ref()
|
||||
.ok_or(Exceptions::IllegalStateException(None))?
|
||||
.getRXingResultPoints();
|
||||
.getPoints();
|
||||
|
||||
let mut result = RXingResult::new(
|
||||
&resultingString,
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
use std::hash::Hash;
|
||||
|
||||
use crate::RXingResultPoint;
|
||||
use crate::Point;
|
||||
|
||||
/**
|
||||
* Encapsulates an RSS barcode finder pattern, including its start/end position and row.
|
||||
@@ -25,7 +25,7 @@ use crate::RXingResultPoint;
|
||||
pub struct FinderPattern {
|
||||
value: u32,
|
||||
startEnd: [usize; 2],
|
||||
resultPoints: Vec<RXingResultPoint>,
|
||||
resultPoints: Vec<Point>,
|
||||
}
|
||||
|
||||
impl FinderPattern {
|
||||
@@ -34,8 +34,8 @@ impl FinderPattern {
|
||||
value,
|
||||
startEnd,
|
||||
resultPoints: vec![
|
||||
RXingResultPoint::new(start as f32, rowNumber as f32),
|
||||
RXingResultPoint::new(end as f32, rowNumber as f32),
|
||||
Point::new(start as f32, rowNumber as f32),
|
||||
Point::new(end as f32, rowNumber as f32),
|
||||
],
|
||||
}
|
||||
}
|
||||
@@ -53,7 +53,7 @@ impl FinderPattern {
|
||||
&mut self.startEnd
|
||||
}
|
||||
|
||||
pub fn getRXingResultPoints(&self) -> &[RXingResultPoint] {
|
||||
pub fn getPoints(&self) -> &[Point] {
|
||||
&self.resultPoints
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ use crate::{
|
||||
common::{BitArray, Result},
|
||||
oned::{one_d_reader, OneDReader},
|
||||
BarcodeFormat, DecodeHintType, DecodeHintValue, DecodingHintDictionary, Exceptions,
|
||||
RXingResult, RXingResultMetadataType, RXingResultMetadataValue, RXingResultPoint, Reader,
|
||||
RXingResult, RXingResultMetadataType, RXingResultMetadataValue, Point, Reader,
|
||||
};
|
||||
|
||||
use super::{
|
||||
@@ -114,8 +114,8 @@ impl Reader for RSS14Reader {
|
||||
);
|
||||
// Update result points
|
||||
let height = rotatedImage.getHeight();
|
||||
let total_points = result.getRXingResultPoints().len();
|
||||
let points = result.getRXingResultPointsMut();
|
||||
let total_points = result.getPoints().len();
|
||||
let points = result.getPointsMut();
|
||||
for point in points.iter_mut().take(total_points) {
|
||||
std::mem::swap(&mut point.x, &mut point.y);
|
||||
point.x = height as f32 - point.x - 1.0
|
||||
@@ -209,8 +209,8 @@ impl RSS14Reader {
|
||||
}
|
||||
buffer.push_str(&checkDigit.to_string());
|
||||
|
||||
let leftPoints = leftPair.getFinderPattern().getRXingResultPoints();
|
||||
let rightPoints = rightPair.getFinderPattern().getRXingResultPoints();
|
||||
let leftPoints = leftPair.getFinderPattern().getPoints();
|
||||
let rightPoints = rightPair.getFinderPattern().getPoints();
|
||||
let mut result = RXingResult::new(
|
||||
&buffer,
|
||||
Vec::new(),
|
||||
@@ -259,7 +259,7 @@ impl RSS14Reader {
|
||||
// row is actually reversed
|
||||
center = row.getSize() as f32 - 1.0 - center;
|
||||
}
|
||||
cb(&RXingResultPoint::new(center, rowNumber as f32));
|
||||
cb(&Point::new(center, rowNumber as f32));
|
||||
}
|
||||
|
||||
let outside = self.decodeDataCharacter(row, &pattern, true)?;
|
||||
|
||||
Reference in New Issue
Block a user