[][src]Struct liriodendron::task::generation::Generation

pub struct Generation {
    grids: HashMap<(u32, u32), (usize, FullPixel)>,
    grids_rows: u32,
    grids_cols: u32,
    nb_grids: usize,
    pixel_ratio: u32,
    border_ratio: u8,
    palette_generation: PaletteGeneration,
    number_generations: u16,
    format: ImageFormat,
    directory_name: String,
    body_de_ratio: f64,
    body_dr_ratio: f64,
}

Task which builds a directory and generate textures inside

Fields

grids: HashMap<(u32, u32), (usize, FullPixel)>grids_rows: u32grids_cols: u32nb_grids: usizepixel_ratio: u32border_ratio: u8palette_generation: PaletteGenerationnumber_generations: u16format: ImageFormatdirectory_name: Stringbody_de_ratio: f64body_dr_ratio: f64

Methods

impl Generation[src]

pub fn new(log: &Log) -> Result<Generation>[src]

Return an error if the created directory name is already taken

fn get_img_width(&self) -> u32[src]

fn get_img_height(&self) -> u32[src]

fn fix_pixel(
    &self,
    image: &mut RgbaImage,
    palette: &Vec<Palette>,
    (row, col): (u32, u32),
    rd: &Vec<f64>
)
[src]

fn fix_empty_pixel(
    &self,
    image: &mut RgbaImage,
    palette: &Vec<Palette>,
    (row, col): (u32, u32),
    rd: &Vec<f64>
)
[src]

fn is_body_pixel(
    &self,
    (row, col): (u32, u32),
    pixel: &FullPixel,
    rd: &Vec<f64>
) -> bool
[src]

fn check_higher_priority_id(&self, id: &mut Option<usize>, neighbour_id: &usize)[src]

fn fix_full_pixel(
    &self,
    image: &mut RgbaImage,
    palette: &Palette,
    (row, col): (u32, u32),
    pixel: FullPixel
)
[src]

fn colorize_image(
    &self,
    image: &mut RgbaImage,
    (x, y): (u32, u32),
    color: Rgba<u8>
)
[src]

Trait Implementations

impl Task for Generation[src]

fn run(&self, current_generation: u16)[src]

Generates one texture called current_generation.png

current_generation is an alphanumeric number

Auto Trait Implementations

impl RefUnwindSafe for Generation

impl Send for Generation

impl Sync for Generation

impl Unpin for Generation

impl UnwindSafe for Generation

Blanket Implementations

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> 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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,