pub struct PixelRotationSession { /* private fields */ }Expand description
Apple’s VTPixelRotationSession — 90° rotation + flip engine for
CVPixelBuffers.
Implementations§
Source§impl PixelRotationSession
impl PixelRotationSession
Sourcepub fn set_rotation(&self, rotation: Rotation) -> Result<(), VTError>
pub fn set_rotation(&self, rotation: Rotation) -> Result<(), VTError>
Configure the rotation applied by Self::rotate. Wraps
kVTPixelRotationPropertyKey_Rotation.
§Errors
Returns VTError::SetPropertyFailed on rejection.
Sourcepub fn set_flip_horizontal(&self, flip: bool) -> Result<(), VTError>
pub fn set_flip_horizontal(&self, flip: bool) -> Result<(), VTError>
Toggle horizontal flip. Wraps
kVTPixelRotationPropertyKey_FlipHorizontalOrientation.
§Errors
Returns VTError::SetPropertyFailed on rejection.
Sourcepub fn set_flip_vertical(&self, flip: bool) -> Result<(), VTError>
pub fn set_flip_vertical(&self, flip: bool) -> Result<(), VTError>
Toggle vertical flip. Wraps
kVTPixelRotationPropertyKey_FlipVerticalOrientation.
§Errors
Returns VTError::SetPropertyFailed on rejection.
Sourcepub fn rotate(
&self,
src: &CVPixelBuffer,
dst: &CVPixelBuffer,
) -> Result<(), VTError>
pub fn rotate( &self, src: &CVPixelBuffer, dst: &CVPixelBuffer, ) -> Result<(), VTError>
Rotate (and optionally flip) src into dst. For 90°/270°
rotations the destination buffer’s width and height must be
the inverse of the source’s.
§Errors
Returns VTError::EncodeFailed on a non-zero OSStatus.
Trait Implementations§
Source§impl Drop for PixelRotationSession
impl Drop for PixelRotationSession
impl Send for PixelRotationSession
impl Sync for PixelRotationSession
Auto Trait Implementations§
impl Freeze for PixelRotationSession
impl RefUnwindSafe for PixelRotationSession
impl Unpin for PixelRotationSession
impl UnsafeUnpin for PixelRotationSession
impl UnwindSafe for PixelRotationSession
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