pub struct BannerImages {
pub bitmap: BannerBitmap,
pub palette: BannerPalette,
pub animation_bitmaps: Option<Box<[BannerBitmap]>>,
pub animation_palettes: Option<Box<[BannerPalette]>>,
pub bitmap_path: PathBuf,
pub palette_path: PathBuf,
}Expand description
Icon for the Banner.
Fields§
§bitmap: BannerBitmapMain bitmap.
palette: BannerPaletteMain palette.
animation_bitmaps: Option<Box<[BannerBitmap]>>Bitmaps for animated icon.
animation_palettes: Option<Box<[BannerPalette]>>Palettes for animated icon
bitmap_path: PathBufPath to bitmap PNG.
palette_path: PathBufPath to palette PNG.
Implementations§
source§impl BannerImages
impl BannerImages
sourcepub fn from_bitmap(bitmap: BannerBitmap, palette: BannerPalette) -> Self
pub fn from_bitmap(bitmap: BannerBitmap, palette: BannerPalette) -> Self
Creates a new BannerImages from a bitmap and palette.
sourcepub fn load(&mut self, path: &Path) -> Result<(), BannerImageError>
pub fn load(&mut self, path: &Path) -> Result<(), BannerImageError>
Loads the bitmap and palette
§Errors
This function will return an error if Reader::open or Reader::decode fails, or if the images are the wrong
size, or the bitmap has a color not present in the palette.
sourcepub fn save_bitmap_file(&self, path: &Path) -> Result<(), BannerImageError>
pub fn save_bitmap_file(&self, path: &Path) -> Result<(), BannerImageError>
Trait Implementations§
source§impl Default for BannerImages
impl Default for BannerImages
source§fn default() -> BannerImages
fn default() -> BannerImages
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for BannerImages
impl<'de> Deserialize<'de> for BannerImages
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for BannerImages
impl RefUnwindSafe for BannerImages
impl Send for BannerImages
impl Sync for BannerImages
impl Unpin for BannerImages
impl UnwindSafe for BannerImages
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