pub struct Decoder(/* private fields */);Expand description
The main class which implements Data Matrix Code decoding -- as opposed to locating and extracting the Data Matrix Code from an image.
@author bbrown@google.com (Brian Brown)
Implementations§
Source§impl Decoder
impl Decoder
pub fn new() -> Self
Sourcepub fn decode(&self, bits: &BitMatrix) -> Result<DecoderRXingResult>
pub fn decode(&self, bits: &BitMatrix) -> Result<DecoderRXingResult>
Decodes a Data Matrix Code represented as a {@link BitMatrix}. A 1 or "true" is taken to mean a black module.
@param bits booleans representing white/black Data Matrix Code modules @return text and bytes encoded within the Data Matrix Code @throws FormatException if the Data Matrix Code cannot be decoded @throws ChecksumException if error correction fails
Sourcepub fn decode_bools(&self, image: &[Vec<bool>]) -> Result<DecoderRXingResult>
pub fn decode_bools(&self, image: &[Vec<bool>]) -> Result<DecoderRXingResult>
Convenience method that can decode a Data Matrix Code represented as a 2D array of booleans. "true" is taken to mean a black module.
@param image booleans representing white/black Data Matrix Code modules @return text and bytes encoded within the Data Matrix Code @throws FormatException if the Data Matrix Code cannot be decoded @throws ChecksumException if error correction fails
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Decoder
impl RefUnwindSafe for Decoder
impl Send for Decoder
impl Sync for Decoder
impl Unpin for Decoder
impl UnsafeUnpin for Decoder
impl UnwindSafe for Decoder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.