[][src]Struct identicon_rs::Identicon

pub struct Identicon { /* fields omitted */ }

Generic Identicon struct

This is the base struct to be used.

Implementations

impl Identicon[src]

pub fn new(
    input_value: &str,
    symmetry: Symmetry,
    border: u32,
    size: u32,
    scale: u32,
    background_color: (u8, u8, u8)
) -> Identicon
[src]

Generates a new identicon with all given parameters

pub fn new_default(input_value: &str) -> Identicon[src]

Generates a new identicon with base library defaults

The defaults are:

  • symmetry: Symmetry::None
  • border: 50
  • size: 5
  • scale: 500
  • background_color: (240, 240, 240)

pub fn new_no_border(input_value: &str) -> Identicon[src]

Generates a new identicon with the defaults with no border

The defaults are:

  • symmetry: Symmetry::None
  • border: 0
  • size: 5
  • scale: 500
  • background_color: (240, 240, 240)

pub fn generate_image(&self) -> DynamicImage[src]

Generates the DynamicImage representing the Identicon

pub fn save_image(&self, output_filename: &str)[src]

Saves the generated image to the given filename

The file formats .png, .jpg, .jpeg, .bmp, and .ico work.

pub fn export_file_data(&self) -> Vec<u8>[src]

Export the file buffer as a Vec

This is for creating a file for a buffer or network response without creating a file on the filesystem.

Auto Trait Implementations

Blanket Implementations

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    D: AdaptFrom<S, Swp, Dwp, T>,
    Dwp: WhitePoint,
    Swp: WhitePoint,
    T: Component + Float
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SetParameter for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.