#[repr(transparent)]pub struct AVRounding(pub i32);
Expand description
Rounding methods used in FFmpeg’s av_rescale_rnd
function.
These rounding modes determine how values are rounded during scaling operations.
See the official FFmpeg documentation: https://ffmpeg.org/doxygen/trunk/group__lavu__math__rational.html
Tuple Fields§
§0: i32
Implementations§
Source§impl AVRounding
impl AVRounding
Sourcepub const Zero: Self
pub const Zero: Self
Round toward zero (truncate fractional part).
- Example:
2.9 -> 2
,-2.9 -> -2
- Equivalent to:
AV_ROUND_ZERO
Sourcepub const AwayFromZero: Self
pub const AwayFromZero: Self
Round away from zero.
- Example:
2.1 -> 3
,-2.1 -> -3
- Equivalent to:
AV_ROUND_INF
Sourcepub const Down: Self
pub const Down: Self
Round toward negative infinity.
- Example:
2.9 -> 2
,-2.1 -> -3
- Equivalent to:
AV_ROUND_DOWN
Sourcepub const Up: Self
pub const Up: Self
Round toward positive infinity.
- Example:
2.1 -> 3
,-2.9 -> -2
- Equivalent to:
AV_ROUND_UP
Sourcepub const NearestAwayFromZero: Self
pub const NearestAwayFromZero: Self
Round to the nearest integer, with halfway cases rounded away from zero.
- Example:
2.5 -> 3
,-2.5 -> -3
- Equivalent to:
AV_ROUND_NEAR_INF
Sourcepub const PassMinMax: Self
pub const PassMinMax: Self
Pass INT64_MIN
/ INT64_MAX
unchanged during rescaling.
Bitmask flag (must be combined with another rounding mode).
- Example:
av_rescale_rnd(3, 1, 2, AV_ROUND_UP | AV_ROUND_PASS_MINMAX);
- Equivalent to:
AV_ROUND_PASS_MINMAX
Trait Implementations§
Source§impl Clone for AVRounding
impl Clone for AVRounding
Source§fn clone(&self) -> AVRounding
fn clone(&self) -> AVRounding
Returns a copy 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 moreSource§impl Debug for AVRounding
impl Debug for AVRounding
Source§impl From<AVRounding> for i32
impl From<AVRounding> for i32
Source§fn from(value: AVRounding) -> Self
fn from(value: AVRounding) -> Self
Converts to this type from the input type.
Source§impl From<AVRounding> for u32
impl From<AVRounding> for u32
Source§fn from(value: AVRounding) -> Self
fn from(value: AVRounding) -> Self
Converts to this type from the input type.
Source§impl From<i32> for AVRounding
impl From<i32> for AVRounding
Source§impl From<u32> for AVRounding
impl From<u32> for AVRounding
Source§impl Hash for AVRounding
impl Hash for AVRounding
Source§impl Ord for AVRounding
impl Ord for AVRounding
Source§fn cmp(&self, other: &AVRounding) -> Ordering
fn cmp(&self, other: &AVRounding) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq<i32> for AVRounding
impl PartialEq<i32> for AVRounding
Source§impl PartialEq for AVRounding
impl PartialEq for AVRounding
Source§impl PartialOrd for AVRounding
impl PartialOrd for AVRounding
impl Copy for AVRounding
impl Eq for AVRounding
impl StructuralPartialEq for AVRounding
Auto Trait Implementations§
impl Freeze for AVRounding
impl RefUnwindSafe for AVRounding
impl Send for AVRounding
impl Sync for AVRounding
impl Unpin for AVRounding
impl UnwindSafe for AVRounding
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