[][src]Struct texture_synthesis::Session

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");

Methods

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. Now, only runs Multiresolution Stochastic Texture Synthesis. Might be interesting to include more algorithms in the future.

Auto Trait Implementations

impl Send for Session

impl Sync for Session

impl Unpin for Session

impl UnwindSafe for Session

impl !RefUnwindSafe for Session

Blanket Implementations

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

impl<T> From<T> for 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.

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

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

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

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