pub struct IcoBuilder { /* private fields */ }
Expand description
Builds an ICO file from individual files. For each size, the closest source image is scaled down to the appropriate size.
Implementations§
Source§impl IcoBuilder
impl IcoBuilder
Sourcepub fn sizes(&mut self, sizes: impl Into<IconSizes>) -> &mut IcoBuilder
pub fn sizes(&mut self, sizes: impl Into<IconSizes>) -> &mut IcoBuilder
Customizes the sizes included in the ICO file. Defaults to IconSizes::MINIMAL
.
Sourcepub fn add_source_file(
&mut self,
source_file: impl AsRef<Path>,
) -> &mut IcoBuilder
pub fn add_source_file( &mut self, source_file: impl AsRef<Path>, ) -> &mut IcoBuilder
Adds a source file. These file can be PNG, BMP or any other format supported by the
image
crate.
The icons are assumed to be a square.
Note that you’ll have to enable the necessary features on the image
crate if you want
to use formats other than PNG or BMP:
# ...
[dependencies]
ico-builder = { version = "...", features = ["jpeg"] }
Sourcepub fn add_source_files(
&mut self,
source_files: impl IntoIterator<Item = impl AsRef<Path>>,
) -> &mut IcoBuilder
pub fn add_source_files( &mut self, source_files: impl IntoIterator<Item = impl AsRef<Path>>, ) -> &mut IcoBuilder
Adds sources files. See: IcoBuilder::add_source_file
.
Sourcepub fn filter_type(&mut self, filter_type: FilterType) -> &mut IcoBuilder
pub fn filter_type(&mut self, filter_type: FilterType) -> &mut IcoBuilder
Customizes the filter type used when downscaling the images. Defaults to FilterType::Lanczos3
.
Trait Implementations§
Source§impl Debug for IcoBuilder
impl Debug for IcoBuilder
Auto Trait Implementations§
impl Freeze for IcoBuilder
impl RefUnwindSafe for IcoBuilder
impl Send for IcoBuilder
impl Sync for IcoBuilder
impl Unpin for IcoBuilder
impl UnwindSafe for IcoBuilder
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