Struct rxing::RGBLuminanceSource
source · pub struct RGBLuminanceSource { /* private fields */ }Expand description
This class is used to help decode images from files which arrive as RGB data from an ARGB pixel array. It does not support rotation.
@author dswitkin@google.com (Daniel Switkin) @author Betaminos
Implementations§
source§impl RGBLuminanceSource
impl RGBLuminanceSource
pub fn new_with_width_height_pixels( width: usize, height: usize, pixels: &[u32] ) -> Self
Trait Implementations§
source§impl Clone for RGBLuminanceSource
impl Clone for RGBLuminanceSource
source§fn clone(&self) -> RGBLuminanceSource
fn clone(&self) -> RGBLuminanceSource
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for RGBLuminanceSource
impl Debug for RGBLuminanceSource
source§impl LuminanceSource for RGBLuminanceSource
impl LuminanceSource for RGBLuminanceSource
source§fn get_row(&self, y: usize) -> Vec<u8> ⓘ
fn get_row(&self, y: usize) -> Vec<u8> ⓘ
gets a row, returns an empty row if we are out of bounds.
source§fn get_matrix(&self) -> Vec<u8> ⓘ
fn get_matrix(&self) -> Vec<u8> ⓘ
Fetches luminance data for the underlying bitmap. Values should be fetched using:
{@code int luminance = array[y * width + x] & 0xff} Read more
source§fn get_height(&self) -> usize
fn get_height(&self) -> usize
@return The height of the bitmap.
source§fn is_crop_supported(&self) -> bool
fn is_crop_supported(&self) -> bool
@return Whether this subclass supports cropping.
source§fn crop(
&self,
left: usize,
top: usize,
width: usize,
height: usize
) -> Result<Self>
fn crop( &self, left: usize, top: usize, width: usize, height: usize ) -> Result<Self>
Returns a new object with cropped image data. Implementations may keep a reference to the
original data rather than a copy. Only callable if isCropSupported() is true. Read more
source§fn invert(&mut self)
fn invert(&mut self)
@return a wrapper of this {@code LuminanceSource} which inverts the luminances it returns – black becomes
white and vice versa, and each value becomes (255-value).
source§fn is_rotate_supported(&self) -> bool
fn is_rotate_supported(&self) -> bool
@return Whether this subclass supports counter-clockwise rotation.
source§fn rotate_counter_clockwise(&self) -> Result<Self>where
Self: Sized,
fn rotate_counter_clockwise(&self) -> Result<Self>where
Self: Sized,
Returns a new object with rotated image data by 90 degrees counterclockwise.
Only callable if {@link #isRotateSupported()} is true. Read more
source§fn rotate_counter_clockwise_45(&self) -> Result<Self>where
Self: Sized,
fn rotate_counter_clockwise_45(&self) -> Result<Self>where
Self: Sized,
Returns a new object with rotated image data by 45 degrees counterclockwise.
Only callable if {@link #isRotateSupported()} is true. Read more
fn invert_block_of_bytes(&self, vec_to_invert: Vec<u8>) -> Vec<u8> ⓘ
Auto Trait Implementations§
impl RefUnwindSafe for RGBLuminanceSource
impl Send for RGBLuminanceSource
impl Sync for RGBLuminanceSource
impl Unpin for RGBLuminanceSource
impl UnwindSafe for RGBLuminanceSource
Blanket Implementations§
§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
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
Mutably borrows from an owned value. Read more
§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
§impl<T> ConvUtil for T
impl<T> ConvUtil for T
§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Approximate the subject to a given type with the default scheme.
§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme,
Approximate the subject to a given type with a specific scheme.
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.§impl<Src> TryFrom<Src> for Src
impl<Src> TryFrom<Src> for Src
§impl<Src, Dst> TryInto<Dst> for Srcwhere
Dst: TryFrom<Src>,
impl<Src, Dst> TryInto<Dst> for Srcwhere
Dst: TryFrom<Src>,
§impl<Src> ValueFrom<Src> for Src
impl<Src> ValueFrom<Src> for Src
§fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>
Convert the given value into an exactly equivalent representation.