[−][src]Struct iconwriter::Icon
A generic representation of an icon.
Implementations
impl<'a> Icon<'a>
[src]
pub fn new(icon_type: IconType, capacity: usize) -> Self
[src]
Creates an Icon
instance.
Arguments
icon_type
The type of the returned icon.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 sizes.
For an explanation of the difference between length and capacity, see
Capacity and reallocation.
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 sizes.
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 sizes.
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 sizes.
For an explanation of the difference between length and capacity, see
Capacity and reallocation.
pub fn add_size(&mut self, size: Size, source: &'a SourceImage) -> Result<()>
[src]
Adds a size binding to the icon.
Returns Err(_)
if the specified size is invalid or is already included in the Icon.
Returns Ok(())
otherwise.
pub fn add_sizes<I: ExactSizeIterator<Item = Size>>(
&mut self,
sizes: I,
source: &'a SourceImage
) -> Result<()>
[src]
&mut self,
sizes: I,
source: &'a SourceImage
) -> Result<()>
Adds a series sizes binding to the icon.
Returns Err(_)
if any of the specified sizes is invalid or is already included in the Icon.
Returns Ok(())
otherwise.
pub fn remove_size(&mut self, size: Size) -> Option<&SourceImage>
[src]
Remove a size binding from the icon.
Returns Some(&SourceImage)
if the icon contains a size binding 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 sizes.
pub fn n_sizes(&self) -> usize
[src]
Returns the total number of sizes in all icon's sizes.
This method avoids allocating unnecessary resources when accessing self.sizes().len()
.
pub fn contains_size(&self, size: Size) -> bool
[src]
Returns true if self.source_map
contains size
. Otherwise returns false.
This method avoids allocating unnecessary resources when accessing self.sizes().includes(&size)
.
pub fn rasterize<F: FnMut(&SourceImage, Size) -> Result<RgbaImage>>(
&self,
resampler: F
) -> Result<Vec<RgbaImage>>
[src]
&self,
resampler: F
) -> Result<Vec<RgbaImage>>
pub fn write<W: Write, F: FnMut(&SourceImage, Size) -> Result<RgbaImage>>(
&self,
w: W,
resampler: F
) -> Result<()>
[src]
&self,
w: W,
resampler: F
) -> Result<()>
Writes the icon to a file or stream.
Trait Implementations
impl<'a> AsRef<HashMap<u32, &'a SourceImage, RandomState>> for Icon<'a>
[src]
pub fn as_ref(&self) -> &HashMap<Size, &'a SourceImage>
[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>,