Struct texture_synthesis::GeneratedImage
source · [−]pub struct GeneratedImage { /* private fields */ }
Expand description
An image generated by a Session::run()
Implementations
sourceimpl GeneratedImage
impl GeneratedImage
sourcepub fn save<P: AsRef<Path>>(&self, path: P) -> Result<(), Error>
pub fn save<P: AsRef<Path>>(&self, path: P) -> Result<(), Error>
Saves the generated image to the specified path
sourcepub fn write<W: Write>(
self,
writer: &mut W,
fmt: ImageOutputFormat
) -> Result<(), Error>
pub fn write<W: Write>(
self,
writer: &mut W,
fmt: ImageOutputFormat
) -> Result<(), Error>
Writes the generated image to the specified stream
sourcepub fn save_debug<P: AsRef<Path>>(&self, dir: P) -> Result<(), Error>
pub fn save_debug<P: AsRef<Path>>(&self, dir: P) -> Result<(), Error>
Saves debug information such as copied patches ids, map ids (if you have multi example generation) and a map indicating generated pixels the generator was “uncertain” of.
sourcepub fn get_coordinate_transform(&self) -> CoordinateTransform
pub fn get_coordinate_transform(&self) -> CoordinateTransform
Get the coordinate transform of this generated image, which can be applied to new example images to get a different output image.
use texture_synthesis as ts;
// create a new session
let texsynth = ts::Session::builder()
//load a single example image
.add_example(&"imgs/1.jpg")
.build().unwrap();
// generate an image
let generated = texsynth.run(None);
// now we can repeat the same transformation on a different image
let repeated_transform_image = generated
.get_coordinate_transform()
.apply(&["imgs/2.jpg"]);
sourcepub fn into_image(self) -> DynamicImage
pub fn into_image(self) -> DynamicImage
Returns the generated output image
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for GeneratedImage
impl Send for GeneratedImage
impl Sync for GeneratedImage
impl Unpin for GeneratedImage
impl UnwindSafe for GeneratedImage
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more