[−][src]Struct iconwriter::Icon
A generic representation of an icon.
Implementations
impl<'a> Icon<'a>
[src]
pub fn ico(capacity: usize) -> Self
[src]
Creates an Icon
with the Ico
icon type.
Arguments
capacity
The target capacity for the underliyngHashMap<IconOptions, &SourceImage>
.
It is important to note that although the returned Icon
has the capacity specified, the Icon
will have zero entries.
For an explanation of the difference between length and capacity, see
Capacity and reallocation.
pub fn icns(capacity: usize) -> Self
[src]
Creates an Icon
with the Icns
icon type.
Arguments
capacity
The target capacity for the underliyngHashMap<IconOptions, &SourceImage>
.
It is important to note that although the returned Icon
has the capacity specified, the Icon
will have zero entries.
For an explanation of the difference between length and capacity, see
Capacity and reallocation.
pub fn png_sequence(capacity: usize) -> Self
[src]
Creates an Icon
with the PngSequece
icon type.
Arguments
capacity
The target capacity for the underliyngHashMap<IconOptions, &SourceImage>
.
It is important to note that although the returned Icon
has the capacity specified, the Icon
will have zero entries.
For an explanation of the difference between length and capacity, see
Capacity and reallocation.
pub fn new(icon_type: IconType, capacity: usize) -> Self
[src]
pub fn add_entry(
&mut self,
opts: IconOptions,
source: &'a SourceImage
) -> Result<()>
[src]
&mut self,
opts: IconOptions,
source: &'a SourceImage
) -> Result<()>
Adds an entry to the icon.
Returns Err(Error::SizeAlreadyIncluded(Size))
if any of the sizes listed in opts.sizes()
is already associated to another entry.
Otherwise returns Ok(())
.
pub fn remove_entry(&mut self, opts: &IconOptions) -> Option<&SourceImage>
[src]
Remove an entry from the icon.
Returns Some(&SourceImage)
if the icon contains an entry associated with the opts
argument. Returns None
otherwise.
pub fn sizes(&self) -> Vec<Size>
[src]
Returns a list of all sizes listed in all icon's entries.
pub fn n_sizes(&self) -> usize
[src]
Returns the total number of sizes in all icon's entries.
This method avoids allocating unnecessary resources when accessing self.sizes().len()
.
pub fn raster(&self) -> Result<Vec<RgbaImage>>
[src]
pub fn write<W: Write + Seek>(&self, w: W) -> Result<()>
[src]
Writes the icon to a file or stream.
Trait Implementations
impl<'a> AsRef<HashMap<IconOptions, &'a SourceImage, RandomState>> for Icon<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for Icon<'a>
impl<'a> !Send for Icon<'a>
impl<'a> !Sync for Icon<'a>
impl<'a> Unpin for Icon<'a>
impl<'a> UnwindSafe for Icon<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> SetParameter for T
pub fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,