IcoEncoder

Struct IcoEncoder 

Source
pub struct IcoEncoder<W>
where W: Write,
{ /* private fields */ }
Expand description

ICO encoder

Implementations§

Source§

impl<W> IcoEncoder<W>
where W: Write,

Source

pub fn new(w: W) -> IcoEncoder<W>

Create a new encoder that writes its output to w.

Source

pub fn encode_images(self, images: &[IcoFrame<'_>]) -> Result<(), ImageError>

Takes some IcoFrames and encodes them into an ICO.

images is a list of images, usually ordered by dimension, which must be between 1 and 65535 (inclusive) in length.

Trait Implementations§

Source§

impl<W> ImageEncoder for IcoEncoder<W>
where W: Write,

Source§

fn write_image( self, buf: &[u8], width: u32, height: u32, color_type: ExtendedColorType, ) -> Result<(), ImageError>

Write an ICO image with the specified width, height, and color type.

For color types with 16-bit per channel or larger, the contents of buf should be in native endian.

WARNING: In image 0.23.14 and earlier this method erroneously expected buf to be in big endian.

Source§

fn set_icc_profile( &mut self, icc_profile: Vec<u8>, ) -> Result<(), UnsupportedError>

Set the ICC profile to use for the image. Read more

Auto Trait Implementations§

§

impl<W> Freeze for IcoEncoder<W>
where W: Freeze,

§

impl<W> RefUnwindSafe for IcoEncoder<W>
where W: RefUnwindSafe,

§

impl<W> Send for IcoEncoder<W>
where W: Send,

§

impl<W> Sync for IcoEncoder<W>
where W: Sync,

§

impl<W> Unpin for IcoEncoder<W>
where W: Unpin,

§

impl<W> UnwindSafe for IcoEncoder<W>
where W: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> RoundFrom<T> for T

Source§

fn round_from(x: T) -> T

Performs the conversion.
Source§

impl<T, U> RoundInto<U> for T
where U: RoundFrom<T>,

Source§

fn round_into(self) -> U

Performs the conversion.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.