mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 12:22:34 +00:00
rename helper methods
This commit is contained in:
@@ -105,7 +105,7 @@ impl Reader for DataMatrixReader {
|
||||
DECODER.decode(&bits)?
|
||||
}
|
||||
} else {
|
||||
return Err(Exceptions::notFoundEmpty());
|
||||
return Err(Exceptions::notFound);
|
||||
};
|
||||
|
||||
// decoderRXingResult = DECODER.decode(detectorRXingResult.getBits())?;
|
||||
@@ -181,10 +181,10 @@ impl DataMatrixReader {
|
||||
*/
|
||||
fn extractPureBits(&self, image: &BitMatrix) -> Result<BitMatrix, Exceptions> {
|
||||
let Some(leftTopBlack) = image.getTopLeftOnBit() else {
|
||||
return Err(Exceptions::notFoundEmpty())
|
||||
return Err(Exceptions::notFound)
|
||||
};
|
||||
let Some(rightBottomBlack) = image.getBottomRightOnBit()else {
|
||||
return Err(Exceptions::notFoundEmpty())
|
||||
return Err(Exceptions::notFound)
|
||||
};
|
||||
|
||||
let moduleSize = Self::moduleSize(&leftTopBlack, image)?;
|
||||
@@ -197,7 +197,7 @@ impl DataMatrixReader {
|
||||
let matrixWidth = (right as i32 - left as i32 + 1) / moduleSize as i32;
|
||||
let matrixHeight = (bottom as i32 - top as i32 + 1) / moduleSize as i32;
|
||||
if matrixWidth <= 0 || matrixHeight <= 0 {
|
||||
return Err(Exceptions::notFoundEmpty());
|
||||
return Err(Exceptions::notFound);
|
||||
// throw NotFoundException.getNotFoundInstance();
|
||||
}
|
||||
|
||||
@@ -234,12 +234,12 @@ impl DataMatrixReader {
|
||||
x += 1;
|
||||
}
|
||||
if x == width {
|
||||
return Err(Exceptions::notFoundEmpty());
|
||||
return Err(Exceptions::notFound);
|
||||
}
|
||||
|
||||
let moduleSize = x - leftTopBlack[0];
|
||||
if moduleSize == 0 {
|
||||
return Err(Exceptions::notFoundEmpty());
|
||||
return Err(Exceptions::notFound);
|
||||
}
|
||||
|
||||
Ok(moduleSize)
|
||||
|
||||
Reference in New Issue
Block a user