[][src]Struct valora::World

pub struct World {
    pub seed: u64,
    pub width: f32,
    pub height: f32,
    pub scale: f32,
    pub frames: Option<usize>,
    pub framerate: usize,
}

The world in which the painting takes place.

Fields

seed: u64

The RNG seed for this painting.

width: f32

The width in coordinate space of the painting.

Coordinate space may differ from output space. If width is 500 but scale is 10, the painting will have a coordinate space width of 500, but the final output will have a width of 5000 pixels.

height: f32

The height in coordinate space of the painting.

Coordinate space may differ from output space. If height is 500 but scale is 10, the painting will have a coordinate space height of 500, but the final output will have a height of 5000 pixels.

scale: f32

The scale of the output.

The final output space is (widthscale)x(heightscale). This value is useful for painting and doing work at one quickly rendering resolution, and later exporting at a much higher resolution while preserving the composition exactly.

This value may be needed when writing shaders or using other raster graphics, to adjust them for the real output size. Vector painting such as with paths should not need to consider this.

frames: Option<usize>

The total number of frames in this painting.

framerate: usize

The number of frames (to try) to render per second.

Methods

impl World[src]

pub fn normalize(&self, p: P2) -> P2[src]

Normalizes coordinates into the range [0, 1] by dividing them by the coordinate space dimensions.

pub fn center(&self) -> P2[src]

Returns the center of the coordinate space.

Trait Implementations

impl Clone for World[src]

impl Copy for World[src]

impl Debug for World[src]

impl Paint for World[src]

Draws a rectangle path covering the entire canvas.

impl StructOpt for World[src]

Auto Trait Implementations

impl RefUnwindSafe for World

impl Send for World

impl Sync for World

impl Unpin for World

impl UnwindSafe for World

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> Content for T where
    T: Copy
[src]

type Owned = T

A type that holds a sized version of the content.

impl<T, U> ConvertInto<U> for T where
    U: ConvertFrom<T>, 
[src]

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

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

impl<P> Paint for P where
    P: Iterator<Item = PathEvent> + Clone
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SetParameter for T

impl<T> SetParameter for T

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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