#[repr(C)]pub struct Int16Complex {
pub real: i16,
pub imag: i16,
}Expand description
A complex number with 16-bit signed integer real and imaginary components.
Corresponds to MRC Mode 3. The byte layout is [real i16, imag i16]
(4 bytes total), stored in file byte order.
Fields§
§real: i16Real component.
imag: i16Imaginary component.
Implementations§
Source§impl Int16Complex
impl Int16Complex
Sourcepub fn to_real(&self, strategy: ComplexToRealStrategy) -> f32
pub fn to_real(&self, strategy: ComplexToRealStrategy) -> f32
Convert this complex number to a real value using the given strategy.
§Example
use mrc::{Int16Complex, ComplexToRealStrategy};
let c = Int16Complex { real: 3, imag: 4 };
assert_eq!(c.to_real(ComplexToRealStrategy::RealPart), 3.0);Trait Implementations§
Source§impl Clone for Int16Complex
impl Clone for Int16Complex
Source§fn clone(&self) -> Int16Complex
fn clone(&self) -> Int16Complex
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for Int16Complex
Source§impl Debug for Int16Complex
impl Debug for Int16Complex
Source§impl Default for Int16Complex
impl Default for Int16Complex
Source§fn default() -> Int16Complex
fn default() -> Int16Complex
Returns the “default value” for a type. Read more
Source§impl PartialEq for Int16Complex
impl PartialEq for Int16Complex
impl StructuralPartialEq for Int16Complex
Auto Trait Implementations§
impl Freeze for Int16Complex
impl RefUnwindSafe for Int16Complex
impl Send for Int16Complex
impl Sync for Int16Complex
impl Unpin for Int16Complex
impl UnsafeUnpin for Int16Complex
impl UnwindSafe for Int16Complex
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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