pub struct ImageFiles<P: FileProperties> { /* private fields */ }
Expand description

Types used for loading files and passing them into the image stitching process A set of image files, storing some file properties internally.

The files can be sorted and truncated according to the options supplied, and then converted into a vector of DynamicImage structs which will contain the actual image data for all files.

Construct using the ImageFilesBuilder struct.

See crate-level documentation for examples.

Implementations§

source§

impl<P: FileProperties> ImageFiles<P>

source

pub fn builder<L: FileLocation<P>>() -> ImageFilesBuilder<P, L>

Create a new ImageFilesBuilder for selecting files

source

pub fn allowed_extensions() -> [&'static str; 5]

Return an array of the accepted file extensions.

These match image formats that can be processed by this crate. Adding individual files with other extensions will fail, and files with other extensions will be ignored if adding whole directories.

source

pub fn get_main_extension(format: ImageFormat) -> Option<&'static str>

Get the “main” extension used by a format.

This is subjective in nature. One thing that is known is that these are all contained in the set of usable formats in ImageFiles::allowed_extensions.

source

pub fn file_count(&self) -> usize

Get the number of files in the current working set

source

pub fn total_size(&self) -> u64

Get the total size, in bytes, of all files in the set

source

pub fn sort_and_truncate_by( self, number_of_files: usize, order_by: OrderBy, take_from: TakeFrom, reverse: bool ) -> Result<Self, String>

Sorts the files according to the options supplied, and truncates the set to the number of files requested by the user

source

pub fn into_image_contents( self, print_info: bool ) -> Result<Vec<DynamicImage>, String>

Load the image data from the files in the set, and return a vector of DynamicImage. The result can then be stitched together.

source

pub fn common_format_in_sources(&self) -> Option<ImageFormat>

Suggest an output format to use for saving the stitch result after loading and stitching the image files in this set.

If all files use the same format, this will be the suggestion. If the formats vary, or if there are no files in the set, then None will be returned.

Auto Trait Implementations§

§

impl<P> RefUnwindSafe for ImageFiles<P>
where P: RefUnwindSafe,

§

impl<P> Send for ImageFiles<P>
where P: Send,

§

impl<P> Sync for ImageFiles<P>
where P: Sync,

§

impl<P> Unpin for ImageFiles<P>
where P: Unpin,

§

impl<P> UnwindSafe for ImageFiles<P>
where P: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.