pub struct SpectralEncoder { /* private fields */ }Expand description
Spectral holographic encoder using DCT.
Encodes 2D tensor data into holographic fragments using DCT (Discrete Cosine Transform). Produces “SV03” format fragments that can be progressively decoded.
§Features
- DCT-based frequency domain encoding
- Configurable fragment count for progressive reconstruction
- Essential coefficient ratio for quality control
Implementations§
Source§impl SpectralEncoder
impl SpectralEncoder
Sourcepub fn with_essential_ratio(self, ratio: f32) -> Self
pub fn with_essential_ratio(self, ratio: f32) -> Self
Set the ratio of coefficients considered essential (replicated in all fragments).
Sourcepub fn encode_2d(
&self,
data: &[f32],
width: usize,
height: usize,
) -> Result<Vec<HoloFragment>>
pub fn encode_2d( &self, data: &[f32], width: usize, height: usize, ) -> Result<Vec<HoloFragment>>
Encode 2D tensor to holographic fragments (V3 format).
V3 format stores DCT coefficients in raster order with NO indices:
- Fragment k: coefficients at positions k, k+F, k+2F, … in raster order
- DC coefficient (position 0) goes to fragment 0 (most important)
- Total size: N×4 bytes (same as original, compresses well with Zstd)
Magic: 0x53563033 (“SV03”) identifies V3 format.
Auto Trait Implementations§
impl Freeze for SpectralEncoder
impl RefUnwindSafe for SpectralEncoder
impl Send for SpectralEncoder
impl Sync for SpectralEncoder
impl Unpin for SpectralEncoder
impl UnwindSafe for SpectralEncoder
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