Struct zxing_cpp::ImageView

source ·
pub struct ImageView<'a>(/* private fields */);

Implementations§

source§

impl<'a> ImageView<'a>

source

pub unsafe fn from_ptr<T: TryInto<c_int>, U: TryInto<c_int>>( ptr: *const u8, width: T, height: T, format: ImageFormat, row_stride: U, pix_stride: U ) -> Result<Self, Error>

Constructs an ImageView from a raw pointer and the width/height (in pixels) and row_stride/pix_stride (in bytes).

§Safety

The memory gets accessed inside the c++ library at random places between ptr and `ptr + height * row_stride + width * pix_stride. Note that both the stride values could be negative, e.g. if the image view is rotated.

source

pub fn from_slice<T: TryInto<c_int> + Clone>( data: &'a [u8], width: T, height: T, format: ImageFormat ) -> Result<Self, Error>

source

pub fn cropped(self, left: i32, top: i32, width: i32, height: i32) -> Self

source

pub fn rotated(self, degree: i32) -> Self

Trait Implementations§

source§

impl<'a> AsRef<ImageView<'a>> for ImageView<'a>

source§

fn as_ref(&self) -> &ImageView<'a>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Drop for ImageView<'_>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for ImageView<'a>

§

impl<'a> !Send for ImageView<'a>

§

impl<'a> !Sync for ImageView<'a>

§

impl<'a> Unpin for ImageView<'a>

§

impl<'a> UnwindSafe for ImageView<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.