pub struct ASCIIGenerator { /* private fields */ }Expand description
A struct used to control the specifics of how an image is converted into ASCII.
Note: Color functions are only available with the “color” feature.
Implementations§
Source§impl ASCIIGenerator
impl ASCIIGenerator
Sourcepub fn set_resize_mod(&mut self, resize_mode: ResizeMode) -> &mut Self
pub fn set_resize_mod(&mut self, resize_mode: ResizeMode) -> &mut Self
Sets the resize mode used when the ASCII is generated.
See ResizeMode
Sourcepub fn set_color(&mut self, color: bool) -> &mut Self
Available on crate feature color only.
pub fn set_color(&mut self, color: bool) -> &mut Self
color only.Sets whether or not to generate the art with color.
Sourcepub fn generate<P: AsRef<Path>>(
&self,
image_path: P,
) -> Result<Vec<Line>, ASCIIError>
pub fn generate<P: AsRef<Path>>( &self, image_path: P, ) -> Result<Vec<Line>, ASCIIError>
Using the current settings, generates image into ASCII.
Throws an ASCIIError if the image at the provided path cannot be found or read.
Trait Implementations§
Source§impl Default for ASCIIGenerator
impl Default for ASCIIGenerator
Source§fn default() -> ASCIIGenerator
fn default() -> ASCIIGenerator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ASCIIGenerator
impl RefUnwindSafe for ASCIIGenerator
impl Send for ASCIIGenerator
impl Sync for ASCIIGenerator
impl Unpin for ASCIIGenerator
impl UnsafeUnpin for ASCIIGenerator
impl UnwindSafe for ASCIIGenerator
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().