struct CbgEncoder {
header: BgiCBGHeader,
stream: MemWriter,
img: ImageData,
key: u32,
magic: u32,
}Available on crate features
bgi and bgi-img only.Fields§
§header: BgiCBGHeader§stream: MemWriter§img: ImageData§key: u32§magic: u32Implementations§
Source§impl CbgEncoder
impl CbgEncoder
pub fn new(img: ImageData) -> Result<Self>
pub fn encode(self) -> Result<Vec<u8>>
fn average_sampling(&self, data: &mut [u8], stride: usize, pixel_size: usize)
fn pack_zeros(input: &[u8]) -> Vec<u8> ⓘ
fn write_int<W: Write>(writer: &mut W, value: i32) -> Result<()>
fn write_encoded(&mut self, data: &[u8]) -> Result<()>
fn update_key(&mut self) -> u8
Auto Trait Implementations§
impl Freeze for CbgEncoder
impl RefUnwindSafe for CbgEncoder
impl Send for CbgEncoder
impl Sync for CbgEncoder
impl Unpin for CbgEncoder
impl UnwindSafe for CbgEncoder
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
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