Struct CbgDecoder

Source
struct CbgDecoder<'a> {
    stream: MsbBitStream<MemReaderRef<'a>>,
    info: &'a BgiCBGHeader,
    color_type: CbgColorType,
    key: u32,
    magic: u32,
    pixel_size: u8,
    stride: usize,
}
Available on crate features bgi and bgi-img only.

Fields§

§stream: MsbBitStream<MemReaderRef<'a>>§info: &'a BgiCBGHeader§color_type: CbgColorType§key: u32§magic: u32§pixel_size: u8§stride: usize

Implementations§

Source§

impl<'a> CbgDecoder<'a>

Source

fn new( reader: MemReaderRef<'a>, info: &'a BgiCBGHeader, color_type: CbgColorType, ) -> Result<Self>

Source

fn unpack(self) -> Result<ImageData>

Source

fn unpack_v1(&mut self) -> Result<ImageData>

Source

fn unpack_v2(&mut self) -> Result<ImageData>

Source

fn read_encoded(&mut self) -> Result<Vec<u8>>

Source

fn read_int(input: &mut MemReaderRef<'_>) -> Result<i32>

Source

fn read_weight_table( input: &mut MemReaderRef<'_>, length: usize, ) -> Result<Vec<u32>>

Source

fn huffman_decompress( &mut self, tree: &HuffmanTree, output: &mut [u8], ) -> Result<()>

Source

fn unpack_zeros(input: &[u8], output: &mut [u8])

Source

fn reverse_average_sampling(&self, output: &mut [u8])

Source

fn update_key(&mut self) -> u8

Auto Trait Implementations§

§

impl<'a> Freeze for CbgDecoder<'a>

§

impl<'a> RefUnwindSafe for CbgDecoder<'a>

§

impl<'a> Send for CbgDecoder<'a>

§

impl<'a> Sync for CbgDecoder<'a>

§

impl<'a> Unpin for CbgDecoder<'a>

§

impl<'a> UnwindSafe for CbgDecoder<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> ErasedDestructor for T
where T: 'static,