pub struct Encoder { /* private fields */ }
Expand description
Encoder type used to produce blurhashes
Implementations§
Source§impl Encoder
impl Encoder
Sourcepub fn auto(bounds: ImageBounds) -> Self
pub fn auto(bounds: ImageBounds) -> Self
Create an encoder that automatically picks Compoent and Skip values
This is a best-effort configuration
Sourcepub fn new(
_: Components,
bounds: ImageBounds,
skip: u32,
) -> Result<Self, ConfigurationError>
pub fn new( _: Components, bounds: ImageBounds, skip: u32, ) -> Result<Self, ConfigurationError>
Create a new Encoder to produce a blurhash
The provided component x and y values must be between 1 and 9 inclusive.
The skip
value indicates how many pixels can be skipped when proccessing the image. this
value will be squared to produce the final skip value. When set to 1, no pixels will be
skipped, when set to 2, one in four pixels will be processed. when set to 3, one in 9
pixels will be processed, etc. This improves performance at the cost of losing accuracy.
Errors if too many components are requested
Auto Trait Implementations§
impl Freeze for Encoder
impl RefUnwindSafe for Encoder
impl Send for Encoder
impl Sync for Encoder
impl Unpin for Encoder
impl UnwindSafe for Encoder
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