Blockies

Type Alias Blockies 

Source
pub type Blockies<const S: usize, T = ()> = [[T; S]; S];
Expand description

Ethereum-style blockies data of type T

An alias type of square 2d-array

§Generic Parameters

  • S (const) - Size of blockies data (number of elements in both width and height)
    • Equal to the size argument in other blockies implementation.
  • T - Type of each element

Trait Implementations§

Source§

impl<const S: usize> BlockiesGenerator<S> for Blockies<S>

Source§

fn data<I: SeedInput>(seed: I) -> Blockies<S, RgbPixel>

Generate an Ethereum-style blockies data Read more
Source§

fn data_mapped<I: SeedInput, T: Clone, F: Fn(RgbPixel) -> T>( seed: I, map_fn: F, ) -> Blockies<S, T>

Generate an Ethereum-style blockies data, mapping each RGB color with map_fn Read more
Source§

fn indexed_data<I: SeedInput>(seed: I) -> (RgbPalette, Blockies<S, ColorClass>)

Generate an Ethereum-style blockies data in indexed image format Read more
Source§

fn indexed_data_mapped<I: SeedInput, T: Clone, F: Fn(RgbPixel) -> T>( seed: I, map_fn: F, ) -> (Palette<T>, Blockies<S, ColorClass>)

Generate an Ethereum-style blockies data in indexed image format, mapping each RGB palette color with map_fn Read more
Source§

fn ansiseq_data<I: SeedInput>( seed: I, output_dim: (usize, usize), is_utf8: bool, ) -> Vec<String>

Generate an Ethereum-style blockies data in ANSI sequence format (terminal-printable) Read more
Source§

fn png_data<I: SeedInput>(seed: I, output_dim: (usize, usize)) -> Vec<u8>

Generate an Ethereum-style blockies data in uncompressed indexed png format Read more
Source§

fn compressed_png_data<I: SeedInput>( seed: I, output_dim: (usize, usize), ) -> Vec<u8>

Available on crate feature compressed_png only.
Generate an Ethereum-style blockies data in compressed indexed png format Read more
Source§

fn png_data_base64<I: SeedInput>( seed: I, output_dim: (usize, usize), data_uri_output: bool, ) -> String

Generate an Ethereum-style blockies data in base64 format of uncompressed indexed png Read more
Source§

fn compressed_png_data_base64<I: SeedInput>( seed: I, output_dim: (usize, usize), data_uri_output: bool, ) -> String

Available on crate feature compressed_png only.
Generate an Ethereum-style blockies data in base64 format of compressed indexed png Read more
Source§

impl<T: Clone, const S: usize> BlockiesHelper<S, T> for Blockies<S, T>

Source§

fn flatten(self) -> Vec<T>

Flatten Blockies 2D data to 1D vector Read more
Source§

fn scale(self, output_dim: (usize, usize)) -> Vec<Vec<T>>

Scale Blockies data to given dimension Read more
Source§

const SIZE: usize = S