pub struct ImageOptions { /* private fields */ }Implementations§
Source§impl ImageOptions
impl ImageOptions
Sourcepub fn bit_map_algorithm(
&mut self,
bit_map_algorithm: BitMapAlgorithm,
) -> &mut Self
pub fn bit_map_algorithm( &mut self, bit_map_algorithm: BitMapAlgorithm, ) -> &mut Self
Examples found in repository?
examples/lena.rs (line 15)
5fn main() -> Result<()> {
6 let img = image::open("./examples/lena.jpg").unwrap();
7 PrinterConfig::tm_t20ii()
8 .build(io::stdout())?
9 .reset()?
10 .println("dithered:")?
11 .image(&EscposImage::new(&img, &Default::default()))?
12 .println("threshold:")?
13 .image(&EscposImage::new(
14 &img,
15 &ImageOptions::default().bit_map_algorithm(BitMapAlgorithm::Threshold(80)),
16 ))?
17 .cut()?;
18 Ok(())
19}Sourcepub fn scale(&mut self, scale: f64) -> Result<&mut Self>
pub fn scale(&mut self, scale: f64) -> Result<&mut Self>
Examples found in repository?
examples/justification.rs (line 8)
6fn main() -> Result<()> {
7 let img = image::open("./examples/lena.jpg").unwrap();
8 let escpos_img = EscposImage::new(&img, ImageOptions::default().scale(0.3)?);
9 PrinterConfig::tm_t20ii()
10 .build(io::stdout())?
11 .reset()?
12 .println("Left: Hello world!")?
13 .image(&escpos_img)?
14 .justification(Justification::Center)?
15 .println("Center: Hello world!")?
16 .image(&escpos_img)?
17 .justification(Justification::Right)?
18 .println("Right: Hello world!")?
19 .image(&escpos_img)?
20 .cut()?;
21 Ok(())
22}pub fn filter_type(&mut self, filter_type: FilterType) -> &mut Self
Trait Implementations§
Source§impl Clone for ImageOptions
impl Clone for ImageOptions
Source§fn clone(&self) -> ImageOptions
fn clone(&self) -> ImageOptions
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 ImageOptions
impl Debug for ImageOptions
Auto Trait Implementations§
impl Freeze for ImageOptions
impl RefUnwindSafe for ImageOptions
impl Send for ImageOptions
impl Sync for ImageOptions
impl Unpin for ImageOptions
impl UnwindSafe for ImageOptions
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