pub struct ImageManager { /* private fields */ }Implementations§
Source§impl ImageManager
impl ImageManager
pub fn new(project_dir: PathBuf) -> Self
pub fn project_dir(&self) -> &Path
pub fn current_append_dir(&self) -> &str
pub fn set_current_append_dir(&mut self, append_dir: impl Into<String>)
pub fn get(&self, id: ImageId) -> Option<&Arc<RgbaImage>>
pub fn get_entry(&self, id: ImageId) -> Option<(&Arc<RgbaImage>, u64)>
Sourcepub fn solid_rgba(&mut self, rgba: (u8, u8, u8, u8)) -> ImageId
pub fn solid_rgba(&mut self, rgba: (u8, u8, u8, u8)) -> ImageId
Create a 1x1 solid RGBA image and return its image id.
This is used for UI placeholders (e.g. message window background) until full UI skinning is implemented.
Sourcepub fn load_bg(&mut self, name: &str) -> Result<ImageId>
pub fn load_bg(&mut self, name: &str) -> Result<ImageId>
Load a BG resource by name (Siglus policy: g00/ then bg/, with extension fallback).
BG is not animated in our current bring-up, so frame index is always 0.
Sourcepub fn load_bg_frame(
&mut self,
name: &str,
frame_index: usize,
) -> Result<ImageId>
pub fn load_bg_frame( &mut self, name: &str, frame_index: usize, ) -> Result<ImageId>
Load a BG resource with an explicit frame index (kept for compatibility).
Sourcepub fn load_g00(&mut self, name: &str, frame_index: u32) -> Result<ImageId>
pub fn load_g00(&mut self, name: &str, frame_index: u32) -> Result<ImageId>
Load an image restricted to the g00/ directory (with extension fallback).
Used for CHR / sprite image loading.
Sourcepub fn load_file(&mut self, path: &Path, frame_index: usize) -> Result<ImageId>
pub fn load_file(&mut self, path: &Path, frame_index: usize) -> Result<ImageId>
Load an image from an explicit path (relative to project_dir if not absolute).
Sourcepub fn insert_image(&mut self, img: RgbaImage) -> ImageId
pub fn insert_image(&mut self, img: RgbaImage) -> ImageId
Insert an already-decoded image into the manager and return a new ImageId.
pub fn insert_image_arc(&mut self, img: Arc<RgbaImage>) -> ImageId
Sourcepub fn replace_image(&mut self, id: ImageId, img: RgbaImage) -> Result<()>
pub fn replace_image(&mut self, id: ImageId, img: RgbaImage) -> Result<()>
Replace an existing image in-place and bump its version.
This allows the renderer to update the GPU texture without changing the ImageId.
pub fn replace_image_arc( &mut self, id: ImageId, img: Arc<RgbaImage>, ) -> Result<()>
pub fn debug_image_info(&self, id: ImageId) -> Option<DebugImageInfo>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ImageManager
impl RefUnwindSafe for ImageManager
impl Send for ImageManager
impl Sync for ImageManager
impl Unpin for ImageManager
impl UnsafeUnpin for ImageManager
impl UnwindSafe for ImageManager
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.