Crate image_to_console_core

Crate image_to_console_core 

Source
Expand description

§image_to_console_core

A library for converting images to terminal friendly format.

§Basic usage example

use image::error::ImageResult;
use image_to_console_core::processor::{ImageProcessor, ImageProcessorOptions};

fn main() -> ImageResult<()> {
    let img = image::open("path/to/image.png")?;

    // Use default config
    let option = ImageProcessorOptions::default();

    let mut processor = ImageProcessor::new(img, option);
    let result = processor.process();
    // Exception handling (this is only shown, not handled, please refer to the actual use of the need)
    let result = result.expect("Process image failed");
    // result.lines contains the formatted terminal output
    // you also can use display method to print
    println!("{}", result.display());
    Ok(())
}

Re-exports§

pub extern crate image;
pub extern crate quantette;
pub extern crate rayon;

Modules§

converter
error
indexed_image
processor
protocol

Macros§

process_images
A macro to process one or more images and return the processed results.
show_image
A macro to display a single image to the terminal using default options or custom options.
show_images
A macro to display multiple images to the terminal.

Structs§

AutoResizeOption
AutoResize Option struct
CustomResizeOption
CustomResize Option struct

Enums§

DisplayMode
The protocol of display
ProcessedImage
Represents an image that has been processed for display purposes
ResizeMode
Resize Mode enum

Functions§

print