pub struct IcoEncoder<W: Write> { /* private fields */ }
Expand description
ICO encoder
Implementations§
source§impl<W: Write> IcoEncoder<W>
impl<W: Write> IcoEncoder<W>
sourcepub fn new(w: W) -> IcoEncoder<W>
pub fn new(w: W) -> IcoEncoder<W>
Create a new encoder that writes its output to w
.
sourcepub fn encode(
self,
data: &[u8],
width: u32,
height: u32,
color: ColorType,
) -> ImageResult<()>
👎Deprecated: Use IcoEncoder::write_image
instead. Beware that write_image
has a different endianness convention
pub fn encode( self, data: &[u8], width: u32, height: u32, color: ColorType, ) -> ImageResult<()>
IcoEncoder::write_image
instead. Beware that write_image
has a different endianness conventionEncodes the image image
that has dimensions width
and
height
and ColorType
c
. The dimensions of the image
must be between 1 and 256 (inclusive) or an error will be returned.
Expects data to be big endian.
sourcepub fn encode_images(self, images: &[IcoFrame<'_>]) -> ImageResult<()>
pub fn encode_images(self, images: &[IcoFrame<'_>]) -> ImageResult<()>
Takes some IcoFrame
s 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: Write> ImageEncoder for IcoEncoder<W>
impl<W: Write> ImageEncoder for IcoEncoder<W>
source§fn write_image(
self,
buf: &[u8],
width: u32,
height: u32,
color_type: ColorType,
) -> ImageResult<()>
fn write_image( self, buf: &[u8], width: u32, height: u32, color_type: ColorType, ) -> ImageResult<()>
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.
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> 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> 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