pub struct ImageView<'a>(/* private fields */);
Implementations§
source§impl<'a> ImageView<'a>
impl<'a> ImageView<'a>
sourcepub 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>
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.
pub fn from_slice<T: TryInto<c_int> + Clone>( data: &'a [u8], width: T, height: T, format: ImageFormat ) -> Result<Self, Error>
pub fn cropped(self, left: i32, top: i32, width: i32, height: i32) -> Self
pub fn rotated(self, degree: i32) -> Self
Trait Implementations§
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> 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