pub enum IconFormats {
Show 21 variants
IS32,
IL32,
IH32,
IT32,
S8MK,
L8MK,
H8MK,
T8MK,
IC04,
IC05,
IC07,
IC08,
IC09,
IC10,
IC11,
IC12,
IC13,
IC14,
ICP4,
ICP5,
ICP6,
}
Expand description
§ICNS Types
These are the types of icons that can be stored in an ICNS file. Not all of them are included, but the most common ones are. The full list can be found at Wikipedia https://en.wikipedia.org/wiki/Apple_Icon_Image_format#Icon_types
Variants§
IS32
- OSName: is32
- Size: 16x16
- Format: 24-bit RGB icon
- OS: System 8.5+
IL32
- OSName: il32
- Size: 32x32
- Format: 24-bit RGB icon
- OS: System 8.5+
IH32
- OSName: ih32
- Size: 48x48
- Format: 24-bit RGB icon
- OS: System 8.5+
IT32
- OSName: it32
- Size: 128x128
- Format: 24-bit RGB icon
- OS: Mac OS X 10.0+
S8MK
- OSName: s8mk
- Size: 16x12
- Format: 8-bit mask
- OS: System 8.5+
L8MK
- OSName: l8mk
- Size: 32x32
- Format: 8-bit mask
- OS: System 8.5+
H8MK
- OSName: h8mk
- Size: 48x48
- Format: 8-bit mask
- OS: System 8.5+
T8MK
- OSName: t8mk
- Size: 128x128
- Format: 8-bit mask
- OS: Mac OS X 10.0+
IC04
- OSName: ic04
- Size: 16x16
- Format: ARGB
- OS: N/A
IC05
- OSName: ic05
- Size: 32x32
- Format: ARGB
- OS: N/A
IC07
- OSName: ic07
- Size: 128x128
- Format: PNG
- OS: Mac OS X 10.7+
IC08
- OSName: ic08
- Size: 256x256
- Format: PNG
- OS: Mac OS X 10.5+
IC09
- OSName: ic09
- Size: 512x512
- Format: PNG
- OS: Mac OS X 10.5+
IC10
- OSName: ic10
- Size: 1024x1024
- Format: PNG
- OS: Mac OS X 10.7+
IC11
- OSName: ic11
- Size: 32x32
- Format: PNG
- OS: Mac OS X 10.8+
IC12
- OSName: ic12
- Size: 64x64
- Format: PNG
- OS: Mac OS X 10.8+
IC13
- OSName: ic13
- Size: 256x256
- Format: PNG
- OS: Mac OS X 10.8+
IC14
- OSName: ic14
- Size: 512x512
- Format: PNG
- OS: Mac OS X 10.8+
ICP4
- OSName: icp4
- Size: 16x16
- Format: PNG
- OS: Mac OS X 10.7+
ICP5
- OSName: icp5
- Size: 32x32
- Format: PNG
- OS: Mac OS X 10.7+
ICP6
- OSName: icp6
- Size: 64x64
- Format: PNG
- OS: Mac OS X 10.7+
Implementations§
Source§impl IconFormats
impl IconFormats
Sourcepub fn recommended() -> Vec<IconFormats>
pub fn recommended() -> Vec<IconFormats>
Get the default recommended format for the icon type.
Examples found in repository?
examples/encode.rs (line 20)
6fn main() -> std::io::Result<()> {
7 // Open the image
8 let image = match open("example.png") {
9 Ok(image) => image,
10 Err(e) => {
11 println!("Error opening file: {}", e);
12 return Ok(());
13 }
14 };
15
16 // Create the encoder
17 let mut encoder = IcnsEncoder::new();
18
19 encoder.data(image);
20 encoder.formats(IconFormats::recommended());
21
22 // Encode the image
23 let data = match encoder.build() {
24 Ok(data) => data,
25 Err(e) => {
26 println!("Error encoding image: {}", e);
27 return Ok(());
28 }
29 };
30
31 // Write data to file
32 let mut file = File::create("example.icns")?;
33 file.write_all(&data)?;
34
35 Ok(())
36}
pub fn get_format(&self) -> FileFormat
pub fn get_size(&self) -> usize
pub fn get_bytes(&self) -> [u8; 4]
Trait Implementations§
Source§impl Clone for IconFormats
impl Clone for IconFormats
Source§fn clone(&self) -> IconFormats
fn clone(&self) -> IconFormats
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for IconFormats
impl Debug for IconFormats
Source§impl Hash for IconFormats
impl Hash for IconFormats
Source§impl PartialEq for IconFormats
impl PartialEq for IconFormats
impl Copy for IconFormats
impl Eq for IconFormats
impl StructuralPartialEq for IconFormats
Auto Trait Implementations§
impl Freeze for IconFormats
impl RefUnwindSafe for IconFormats
impl Send for IconFormats
impl Sync for IconFormats
impl Unpin for IconFormats
impl UnwindSafe for IconFormats
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more