Enum rofl::Template
[−]
[src]
pub enum Template { Image(DynamicImage, ImageFormat), Animation(GifAnimation), }
Represents an image macro template.
Currently, templates can either be regular (still) images, or animations loaded from a GIF file.
Variants
Image(DynamicImage, ImageFormat)
Single still image, loaded from some image format.
Animation(GifAnimation)
An animation, loaded from a GIF.
Methods
impl Template
[src]
fn for_image<P: AsRef<Path>>(img: DynamicImage, path: P) -> Self
Create the template for an image loaded from a file. Image format is figured out from the file extension.
fn for_gif_animation(gif_anim: GifAnimation) -> Self
Create the template for an animation loaded from a GIF file.
impl Template
[src]
fn is_animated(&self) -> bool
Whether this is an animated template.
fn image_count(&self) -> usize
Number of images that comprise the template
fn iter_images<'t>(&'t self) -> Box<Iterator<Item = &'t DynamicImage> + 't>
Iterate over all DynamicImages in this template.
fn preferred_format(&self) -> ImageFormat
The preferred format for image macros generated using this template. This is usually the same that the template was loaded from.
Trait Implementations
impl Clone for Template
[src]
fn clone(&self) -> Template
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more