pub struct GifEncoder { /* private fields */ }Expand description
GIF encoder for creating GIF89a files.
Supports:
- Single images and animations
- Color quantization with configurable palette size
- Dithering options
- Transparency
- Loop count control
Implementations§
Source§impl GifEncoder
impl GifEncoder
Sourcepub fn new(
width: u32,
height: u32,
config: GifEncoderConfig,
) -> CodecResult<Self>
pub fn new( width: u32, height: u32, config: GifEncoderConfig, ) -> CodecResult<Self>
Sourcepub fn encode(
&mut self,
frames: &[VideoFrame],
frame_configs: &[GifFrameConfig],
) -> CodecResult<Vec<u8>>
pub fn encode( &mut self, frames: &[VideoFrame], frame_configs: &[GifFrameConfig], ) -> CodecResult<Vec<u8>>
Sourcepub fn encode_single(&mut self, frame: &VideoFrame) -> CodecResult<Vec<u8>>
pub fn encode_single(&mut self, frame: &VideoFrame) -> CodecResult<Vec<u8>>
Sourcepub fn encode_animation(
&mut self,
frames: &[VideoFrame],
delay_ms: u32,
) -> CodecResult<Vec<u8>>
pub fn encode_animation( &mut self, frames: &[VideoFrame], delay_ms: u32, ) -> CodecResult<Vec<u8>>
Auto Trait Implementations§
impl Freeze for GifEncoder
impl RefUnwindSafe for GifEncoder
impl Send for GifEncoder
impl Sync for GifEncoder
impl Unpin for GifEncoder
impl UnsafeUnpin for GifEncoder
impl UnwindSafe for GifEncoder
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