pub struct ChannelSamples<'slice, 'sample: 'slice> { /* private fields */ }Expand description
Can construct iterators over actual iterator over the channel data for a sample, yielded by
SamplesIter. Can be turned into an iterator, or ChannelSamples::iter_mut() can be used
to iterate over the channel data multiple times, or more efficiently you can use
ChannelSamples::get_unchecked_mut() to do the same thing.
Implementations§
Source§impl<'slice, 'sample> ChannelSamples<'slice, 'sample>
impl<'slice, 'sample> ChannelSamples<'slice, 'sample>
Sourcepub fn iter_mut(&mut self) -> ChannelSamplesIter<'slice, 'sample> ⓘ
pub fn iter_mut(&mut self) -> ChannelSamplesIter<'slice, 'sample> ⓘ
A resetting iterator. This lets you iterate over the same channels multiple times. Otherwise
you don’t need to use this function as ChannelSamples already implements
IntoIterator.
Sourcepub fn get_mut(&mut self, channel_index: usize) -> Option<&mut f32>
pub fn get_mut(&mut self, channel_index: usize) -> Option<&mut f32>
Access a sample by index. Useful when you would otherwise iterate over this ‘Channels’ iterator multiple times.
Sourcepub unsafe fn get_unchecked_mut(&mut self, channel_index: usize) -> &mut f32
pub unsafe fn get_unchecked_mut(&mut self, channel_index: usize) -> &mut f32
Sourcepub fn to_simd<const LANES: usize>(&self) -> Simd<f32, LANES>
pub fn to_simd<const LANES: usize>(&self) -> Simd<f32, LANES>
Get a SIMD vector containing the channel data for this buffer. If LANES > channels.len()
then this will be padded with zeroes. If LANES < channels.len() then this won’t contain
all values.
Sourcepub unsafe fn to_simd_unchecked<const LANES: usize>(&self) -> Simd<f32, LANES>
pub unsafe fn to_simd_unchecked<const LANES: usize>(&self) -> Simd<f32, LANES>
Get a SIMD vector containing the channel data for this buffer. Will always read exactly
LANES channels.
§Safety
Undefined behavior if LANES > channels.len().