Struct texture_synthesis::session::Session[][src]

pub struct Session { /* fields omitted */ }

Texture synthesis session.

Calling run() will generate a new image and return it, consuming the session in the process. You can provide a GeneratorProgress implementation to periodically get updates with the currently generated image and the number of pixels that have been resolved both in the current stage and globally.

Example

let tex_synth = texture_synthesis::Session::builder()
    .seed(10)
    .tiling_mode(true)
    .add_example(&"imgs/1.jpg")
    .build().expect("failed to build session");

let generated_img = tex_synth.run(None);
generated_img.save("my_generated_img.jpg").expect("failed to save image");

Implementations

impl Session[src]

pub fn builder<'a>() -> SessionBuilder<'a>[src]

Creates a new session with default parameters.

pub fn run(self, progress: Option<Box<dyn GeneratorProgress>>) -> GeneratedImage[src]

Runs the generator and outputs a generated image.

Auto Trait Implementations

impl !RefUnwindSafe for Session

impl Send for Session

impl Sync for Session

impl Unpin for Session

impl UnwindSafe for Session

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