pub struct LensDistortionCorrector { /* private fields */ }Expand description
Lens distortion corrector.
Removes lens distortion from RGBA frames using the Brown-Conrady model.
Implementations§
Source§impl LensDistortionCorrector
impl LensDistortionCorrector
Sourcepub fn new(params: LensDistortionParams) -> Self
pub fn new(params: LensDistortionParams) -> Self
Create a new corrector with the given lens parameters.
Sourcepub fn undistort_rgba(
&self,
src: &[u8],
src_w: u32,
src_h: u32,
dst: &mut [u8],
) -> Result<()>
pub fn undistort_rgba( &self, src: &[u8], src_w: u32, src_h: u32, dst: &mut [u8], ) -> Result<()>
Remove lens distortion from an RGBA frame.
For each output pixel the undistortion mapping is applied to find the source location, which is sampled bilinearly.
§Errors
Returns an error if src and dst buffer sizes don’t match the
declared dimensions.
Trait Implementations§
Source§impl Clone for LensDistortionCorrector
impl Clone for LensDistortionCorrector
Source§fn clone(&self) -> LensDistortionCorrector
fn clone(&self) -> LensDistortionCorrector
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for LensDistortionCorrector
impl RefUnwindSafe for LensDistortionCorrector
impl Send for LensDistortionCorrector
impl Sync for LensDistortionCorrector
impl Unpin for LensDistortionCorrector
impl UnsafeUnpin for LensDistortionCorrector
impl UnwindSafe for LensDistortionCorrector
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more