[][src]Struct compress::entropy::ari::RangeEncoder

pub struct RangeEncoder {
    pub threshold: Border,
    // some fields omitted
}

Range Encoder basic primitive Gets probability ranges on the input, produces whole bytes of code on the output, where the code is an arbitrary fixed-ppoint value inside the resulting probability range.

Fields

threshold: Border

The minimum distance between low and hai to keep at all times, has to be at least the largest incoming 'total', and optimally many times larger

Implementations

impl RangeEncoder[src]

pub fn new(max_range: Border) -> RangeEncoder[src]

Create a new instance will keep the active range below 'max_range'

pub fn reset(&mut self)[src]

Reset the current range

pub fn process(
    &mut self,
    total: Border,
    from: Border,
    to: Border,
    output: &mut [Symbol]
) -> usize
[src]

Process a given interval [from/total,to/total) into the current range write into the output slice, and return the number of symbols produced

pub fn query(&self, total: Border, code: Border) -> Border[src]

Query the value encoded by 'code' in range [0,total)

pub fn get_code_tail(&mut self) -> Border[src]

Get the code tail and close the range used at the end of encoding

Auto Trait Implementations

impl RefUnwindSafe for RangeEncoder

impl Send for RangeEncoder

impl Sync for RangeEncoder

impl Unpin for RangeEncoder

impl UnwindSafe for RangeEncoder

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]