mirror of
https://github.com/starovoid/rxing.git
synced 2026-07-26 20:32:34 +00:00
high level encoder builds
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
|
||||
//package com.google.zxing.common;
|
||||
|
||||
use std::fmt::Display;
|
||||
|
||||
use crate::Exceptions;
|
||||
|
||||
/**
|
||||
@@ -23,7 +25,7 @@ use crate::Exceptions;
|
||||
*
|
||||
* @author Alex Geller
|
||||
*/
|
||||
pub trait ECIInput {
|
||||
pub trait ECIInput:Display {
|
||||
/**
|
||||
* Returns the length of this input. The length is the number
|
||||
* of {@code byte}s in or ECIs in the sequence.
|
||||
@@ -103,6 +105,6 @@ pub trait ECIInput {
|
||||
* @throws IllegalArgumentException
|
||||
* if the value at the {@code index} argument is not an ECI (@see #isECI)
|
||||
*/
|
||||
fn getECIValue(&self, index: usize) -> Result<u32, Exceptions>;
|
||||
fn getECIValue(&self, index: usize) -> Result<i32, Exceptions>;
|
||||
fn haveNCharacters(&self, index: usize, n: usize) -> bool;
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ impl ECIInput for MinimalECIInput {
|
||||
* @throws IllegalArgumentException
|
||||
* if the value at the {@code index} argument is not an ECI (@see #isECI)
|
||||
*/
|
||||
fn getECIValue(&self, index: usize) -> Result<u32, Exceptions> {
|
||||
fn getECIValue(&self, index: usize) -> Result<i32, Exceptions> {
|
||||
if index >= self.length() {
|
||||
return Err(Exceptions::IndexOutOfBoundsException(index.to_string()));
|
||||
}
|
||||
@@ -172,7 +172,7 @@ impl ECIInput for MinimalECIInput {
|
||||
index
|
||||
)));
|
||||
}
|
||||
Ok((self.bytes[index] as u32 - 256) as u32)
|
||||
Ok((self.bytes[index] as u32 - 256) as i32)
|
||||
}
|
||||
|
||||
fn haveNCharacters(&self, index: usize, n: usize) -> bool {
|
||||
|
||||
Reference in New Issue
Block a user