pub struct StandardEncoder { /* private fields */ }Expand description
Standard lossless GIF encoder.
This encoder produces standard GIF files using the gif crate.
It supports resizing and basic optimization but does not perform
lossy compression.
§Example
ⓘ
use figif_core::encoders::StandardEncoder;
use figif_core::traits::GifEncoder;
let encoder = StandardEncoder::new();
let bytes = encoder.encode(&frames, &EncodeConfig::default())?;Implementations§
Source§impl StandardEncoder
impl StandardEncoder
Sourcepub fn with_resize_filter(self, filter: ResizeFilter) -> Self
pub fn with_resize_filter(self, filter: ResizeFilter) -> Self
Set the resize filter.
Trait Implementations§
Source§impl Clone for StandardEncoder
impl Clone for StandardEncoder
Source§fn clone(&self) -> StandardEncoder
fn clone(&self) -> StandardEncoder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StandardEncoder
impl Debug for StandardEncoder
Source§impl Default for StandardEncoder
impl Default for StandardEncoder
Source§fn default() -> StandardEncoder
fn default() -> StandardEncoder
Returns the “default value” for a type. Read more
Source§impl GifEncoder for StandardEncoder
impl GifEncoder for StandardEncoder
Source§fn encode(
&self,
frames: &[EncodableFrame],
config: &EncodeConfig,
) -> Result<Vec<u8>>
fn encode( &self, frames: &[EncodableFrame], config: &EncodeConfig, ) -> Result<Vec<u8>>
Encode frames to a byte vector.
Source§fn encode_to_file(
&self,
frames: &[EncodableFrame],
path: impl AsRef<Path>,
config: &EncodeConfig,
) -> Result<()>
fn encode_to_file( &self, frames: &[EncodableFrame], path: impl AsRef<Path>, config: &EncodeConfig, ) -> Result<()>
Encode frames to a file.
Source§fn encode_to_writer<W: Write>(
&self,
frames: &[EncodableFrame],
writer: W,
config: &EncodeConfig,
) -> Result<()>
fn encode_to_writer<W: Write>( &self, frames: &[EncodableFrame], writer: W, config: &EncodeConfig, ) -> Result<()>
Encode frames to any writer.
Source§fn supports_lossy(&self) -> bool
fn supports_lossy(&self) -> bool
Whether this encoder supports lossy compression.
Auto Trait Implementations§
impl Freeze for StandardEncoder
impl RefUnwindSafe for StandardEncoder
impl Send for StandardEncoder
impl Sync for StandardEncoder
impl Unpin for StandardEncoder
impl UnsafeUnpin for StandardEncoder
impl UnwindSafe for StandardEncoder
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> GifEncoderExt for Twhere
T: GifEncoder,
impl<T> GifEncoderExt for Twhere
T: GifEncoder,
Source§fn encode_default(&self, frames: &[EncodableFrame]) -> Result<Vec<u8>>
fn encode_default(&self, frames: &[EncodableFrame]) -> Result<Vec<u8>>
Encode with default configuration.
Source§fn can_encode(&self, config: &EncodeConfig) -> bool
fn can_encode(&self, config: &EncodeConfig) -> bool
Check if this encoder can handle the given configuration.
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