[−][src]Struct rqrr::SearchableImage
An black-and-white image that can be mutated on search for QR codes
During search for QR codes, some black zones will be recolored in 'different' shades of black. This is done to speed up the search and mitigate the impact of a huge zones.
Methods
impl SearchableImage
[src]
pub fn from_dynamic(img: &DynamicImage) -> Self
[src]
Given an image, create a searchable copy of it
This first converts the image to greyscale before filling its own buffer
pub fn from_bitmap<F>(w: usize, h: usize, fill: F) -> Self where
F: FnMut(usize, usize) -> bool,
[src]
F: FnMut(usize, usize) -> bool,
Given a function with binary output, generate a searchable image
If the given function returns true
the matching pixel will be 'black'.
pub fn from_greyscale<F>(w: usize, h: usize, fill: F) -> Self where
F: FnMut(usize, usize) -> u8,
[src]
F: FnMut(usize, usize) -> u8,
Given a byte valued function, generate a searchable image
The values returned by the function are interpreted as luminance. i.e. a value of 0 is black, 255 is white.
pub fn width(&self) -> usize
[src]
Return the width of the image
pub fn height(&self) -> usize
[src]
Return the height of the image
Trait Implementations
impl Clone for SearchableImage
[src]
fn clone(&self) -> SearchableImage
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Index<(Range<usize>, usize)> for SearchableImage
[src]
type Output = [u8]
The returned type after indexing.
fn index(&self, (xs, y): (Range<usize>, usize)) -> &Self::Output
[src]
impl Index<Point> for SearchableImage
[src]
type Output = u8
The returned type after indexing.
fn index(&self, index: Point) -> &Self::Output
[src]
impl Index<(usize, usize)> for SearchableImage
[src]
type Output = u8
The returned type after indexing.
fn index(&self, (x, y): (usize, usize)) -> &Self::Output
[src]
impl IndexMut<(Range<usize>, usize)> for SearchableImage
[src]
impl IndexMut<Point> for SearchableImage
[src]
impl IndexMut<(usize, usize)> for SearchableImage
[src]
Auto Trait Implementations
impl Send for SearchableImage
impl Sync for SearchableImage
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
Sets value
as a parameter of self
.