pub struct BackgroundPickerApp {
pub args: Args,
pub images: Arc<RwLock<Vec<ImageInfo>>>,
pub folder_tree: HashMap<String, Vec<usize>>,
pub loading: bool,
pub thumbnail_sender: Sender<(usize, ColorImage)>,
pub thumbnail_receiver: Receiver<(usize, ColorImage)>,
pub thread_pool: ThreadPool,
pub cache_dir: PathBuf,
}Fields§
§args: Args§images: Arc<RwLock<Vec<ImageInfo>>>§folder_tree: HashMap<String, Vec<usize>>§loading: bool§thumbnail_sender: Sender<(usize, ColorImage)>§thumbnail_receiver: Receiver<(usize, ColorImage)>§thread_pool: ThreadPool§cache_dir: PathBufImplementations§
Source§impl BackgroundPickerApp
impl BackgroundPickerApp
pub fn new(_cc: &CreationContext<'_>, args: Args) -> Result<Self>
pub fn get_thumbnail_cache_dir() -> Result<PathBuf>
pub fn find_existing_thumbnail(file_path: &Path) -> Option<PathBuf>
pub fn get_thumbnail_hash(file_path: &Path) -> Option<String>
pub fn scan_images(&mut self) -> Result<()>
pub fn pregenerate_all_thumbnails(&mut self) -> Result<()>
pub fn load_thumbnail(&mut self, _ctx: &Context, index: usize)
pub fn load_or_generate_thumbnail( path: &Path, size: u32, cache_dir: &Path, debug: bool, ) -> Option<ColorImage>
pub fn get_cached_thumbnail_path_static( file_path: &Path, cache_dir: &Path, ) -> Option<PathBuf>
pub fn is_thumbnail_cache_valid_static( original_path: &Path, cache_path: &Path, ) -> bool
pub fn load_cached_thumbnail( cache_path: &Path, target_size: u32, ) -> Option<ColorImage>
pub fn save_thumbnail_to_cache( color_image: &ColorImage, cache_path: &Path, original_path: &Path, )
pub fn save_thumbnail_with_metadata( img: &DynamicImage, cache_path: &Path, original_path: &Path, )
pub fn fast_thumbnail_generation(path: &Path, size: u32) -> Option<ColorImage>
pub fn create_thumbnail_fast(img: DynamicImage, size: u32) -> Option<ColorImage>
pub fn process_thumbnail_results(&mut self, ctx: &Context)
pub fn preload_batch(&mut self, indices: &[usize])
pub fn set_background(&self, path: &Path) -> Result<()>
pub fn save_selected_image(&self, path: &Path) -> Result<()>
Trait Implementations§
Source§impl App for BackgroundPickerApp
impl App for BackgroundPickerApp
Source§fn update(&mut self, ctx: &Context, _frame: &mut Frame)
fn update(&mut self, ctx: &Context, _frame: &mut Frame)
Called each time the UI needs repainting, which may be many times per second. Read more
Source§fn save(&mut self, _storage: &mut dyn Storage)
fn save(&mut self, _storage: &mut dyn Storage)
Called on shutdown, and perhaps at regular intervals. Allows you to save state. Read more
Source§fn on_exit(&mut self, _gl: Option<&Context>)
fn on_exit(&mut self, _gl: Option<&Context>)
Called once on shutdown, after
Self::save. Read moreSource§fn auto_save_interval(&self) -> Duration
fn auto_save_interval(&self) -> Duration
Time between automatic calls to
Self::saveSource§fn clear_color(&self, _visuals: &Visuals) -> [f32; 4]
fn clear_color(&self, _visuals: &Visuals) -> [f32; 4]
Background color values for the app, e.g. what is sent to
gl.clearColor. Read moreSource§fn persist_egui_memory(&self) -> bool
fn persist_egui_memory(&self) -> bool
Controls whether or not the egui memory (window positions etc) will be
persisted (only if the “persistence” feature is enabled).
Source§fn raw_input_hook(&mut self, _ctx: &Context, _raw_input: &mut RawInput)
fn raw_input_hook(&mut self, _ctx: &Context, _raw_input: &mut RawInput)
A hook for manipulating or filtering raw input before it is processed by
Self::update. Read moreAuto Trait Implementations§
impl Freeze for BackgroundPickerApp
impl !RefUnwindSafe for BackgroundPickerApp
impl Send for BackgroundPickerApp
impl !Sync for BackgroundPickerApp
impl Unpin for BackgroundPickerApp
impl !UnwindSafe for BackgroundPickerApp
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more