pub struct CVImageBuffer(/* private fields */);Available on crate feature
cv only.Expand description
Generic CVImageBufferRef wrapper.
Implementations§
Source§impl CVImageBuffer
impl CVImageBuffer
Sourcepub unsafe fn from_raw(ptr: *mut c_void) -> Option<Self>
pub unsafe fn from_raw(ptr: *mut c_void) -> Option<Self>
Adopts a +1 retained CVImageBufferRef and returns None for null.
§Safety
A non-null ptr must be a live CVImageBufferRef of the exact type
carrying one retain transferred to this wrapper. The caller must not
release or separately adopt that transferred retain.
Sourcepub unsafe fn from_raw_borrowed(ptr: *mut c_void) -> Option<Self>
pub unsafe fn from_raw_borrowed(ptr: *mut c_void) -> Option<Self>
Retains a +0 borrowed CVImageBufferRef and returns an owned wrapper.
§Safety
A non-null ptr must be a live CVImageBufferRef of the exact type for
the duration of the retain call.
Sourcepub fn from_pixel_buffer(pixel_buffer: &CVPixelBuffer) -> Option<Self>
pub fn from_pixel_buffer(pixel_buffer: &CVPixelBuffer) -> Option<Self>
Wrap a pixel buffer as a generic image buffer.
Sourcepub const fn as_ptr(&self) -> *mut c_void
pub const fn as_ptr(&self) -> *mut c_void
Borrow the raw +0 CVImageBufferRef while self remains alive.
Sourcepub fn encoded_size(&self) -> CVImageSize
pub fn encoded_size(&self) -> CVImageSize
Encoded image size.
Sourcepub fn display_size(&self) -> CVImageSize
pub fn display_size(&self) -> CVImageSize
Display size.
Sourcepub fn clean_rect(&self) -> CVImageRect
pub fn clean_rect(&self) -> CVImageRect
Clean aperture rectangle.
Trait Implementations§
Source§impl Clone for CVImageBuffer
impl Clone for CVImageBuffer
Source§impl Debug for CVImageBuffer
impl Debug for CVImageBuffer
Source§impl Drop for CVImageBuffer
impl Drop for CVImageBuffer
impl Eq for CVImageBuffer
Source§impl Hash for CVImageBuffer
impl Hash for CVImageBuffer
Auto Trait Implementations§
impl !Send for CVImageBuffer
impl !Sync for CVImageBuffer
impl Freeze for CVImageBuffer
impl RefUnwindSafe for CVImageBuffer
impl Unpin for CVImageBuffer
impl UnsafeUnpin for CVImageBuffer
impl UnwindSafe for CVImageBuffer
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