Struct rxing::BufferedImageLuminanceSource
source · pub struct BufferedImageLuminanceSource { /* private fields */ }Expand description
This LuminanceSource implementation is meant for J2SE clients and our blackbox unit tests.
@author dswitkin@google.com (Daniel Switkin) @author Sean Owen @author code@elektrowolle.de (Wolfgang Jung)
Implementations§
source§impl BufferedImageLuminanceSource
impl BufferedImageLuminanceSource
pub fn new(image: DynamicImage) -> Self
pub fn with_details(
image: DynamicImage,
left: u32,
top: u32,
width: usize,
height: usize
) -> Self
Trait Implementations§
source§impl LuminanceSource for BufferedImageLuminanceSource
impl LuminanceSource for BufferedImageLuminanceSource
source§fn getRow(&self, y: usize) -> Vec<u8> ⓘ
fn getRow(&self, y: usize) -> Vec<u8> ⓘ
Fetches one row of luminance data from the underlying platform’s bitmap. Values range from
0 (black) to 255 (white). Because Java does not have an unsigned byte type, callers will have
to bitwise and with 0xff for each value. It is preferable for implementations of this method
to only fetch this row rather than the whole image, since no 2D Readers may be installed and
getMatrix() may never be called. Read more
source§fn getMatrix(&self) -> Vec<u8> ⓘ
fn getMatrix(&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 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 isCropSupported(&self) -> bool
fn isCropSupported(&self) -> bool
@return Whether this subclass supports cropping.
source§fn crop(
&self,
left: usize,
top: usize,
width: usize,
height: usize
) -> Result<Box<dyn LuminanceSource>, Exceptions>
fn crop(
&self,
left: usize,
top: usize,
width: usize,
height: usize
) -> Result<Box<dyn LuminanceSource>, Exceptions>
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 isRotateSupported(&self) -> bool
fn isRotateSupported(&self) -> bool
@return Whether this subclass supports counter-clockwise rotation.
source§fn rotateCounterClockwise(&self) -> Result<Box<dyn LuminanceSource>, Exceptions>
fn rotateCounterClockwise(&self) -> Result<Box<dyn LuminanceSource>, Exceptions>
Returns a new object with rotated image data by 90 degrees counterclockwise.
Only callable if {@link #isRotateSupported()} is true. Read more
source§fn rotateCounterClockwise45(
&self
) -> Result<Box<dyn LuminanceSource>, Exceptions>
fn rotateCounterClockwise45(
&self
) -> Result<Box<dyn LuminanceSource>, Exceptions>
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 BufferedImageLuminanceSource
impl !Send for BufferedImageLuminanceSource
impl !Sync for BufferedImageLuminanceSource
impl Unpin for BufferedImageLuminanceSource
impl UnwindSafe for BufferedImageLuminanceSource
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.
§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, DefaultApprox>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst, DefaultApprox>,
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.