[−][src]Struct img_parts::webp::WebP
The representation of a WebP image
Implementations
impl WebP
[src]
pub fn new(riff: RiffChunk) -> Result<WebP>
[src]
Construct a new WebP
image from a RiffChunk
.
Errors
This method returns a Error::WrongSignature
if the content of the RiffChunk
isn't a List
or
if the list's kind isn't "WEBP".
pub fn from_bytes(b: Bytes) -> Result<WebP>
[src]
Create a new WebP
image from a Reader.
Errors
This method fails if the file signature doesn't match or if it is corrupted or truncated.
pub fn kind(&self) -> VP8Kind
[src]
Get the VP8Kind
of this WebP
.
pub fn dimensions(&self) -> Option<(u32, u32)>
[src]
Get the width and height of this WebP
.
If this WebP
has a VP8X
chunk the dimension is the canvas size.
Otherwise the dimension is read from the VP8 bitstream header.
pub fn chunks(&self) -> &Vec<RiffChunk>
[src]
Get the chunks of this WebP
.
pub fn chunks_mut(&mut self) -> &mut Vec<RiffChunk>
[src]
Get a mutable reference to the chunks of this WebP
.
pub fn has_chunk(&self, id: [u8; 4]) -> bool
[src]
Check if there's a chunk with an id of id
.
pub fn chunk_by_id(&self, id: [u8; 4]) -> Option<&RiffChunk>
[src]
Get the first chunk with an id of id
.
pub fn chunks_by_id(&self, id: [u8; 4]) -> impl Iterator<Item = &RiffChunk>
[src]
Get every chunk with an id of id
.
pub fn remove_chunks_by_id(&mut self, id: [u8; 4])
[src]
Remove every chunk with an id of id
pub fn len(&self) -> u32
[src]
Get the total size of the WebP
once it is encoded.
Internally calls RiffChunk::len
on the
inner RiffChunk
pub fn encoder(self) -> ImageEncoder<RiffChunk>ⓘNotable traits for ImageEncoder<I>
impl<I: EncodeAt> Iterator for ImageEncoder<I> type Item = Bytes;
[src]
Notable traits for ImageEncoder<I>
impl<I: EncodeAt> Iterator for ImageEncoder<I> type Item = Bytes;
Create an encoder for this WebP
Internally calls RiffChunk::encoder
on the
inner RiffChunk
Trait Implementations
impl Clone for WebP
[src]
impl Debug for WebP
[src]
impl From<WebP> for DynImage
[src]
impl ImageEXIF for WebP
[src]
impl ImageICC for WebP
[src]
fn icc_profile(&self) -> Option<Bytes>
[src]
fn set_icc_profile(&mut self, profile: Option<Bytes>)
[src]
impl PartialEq<WebP> for WebP
[src]
impl StructuralPartialEq for WebP
[src]
Auto Trait Implementations
impl RefUnwindSafe for WebP
impl Send for WebP
impl Sync for WebP
impl Unpin for WebP
impl UnwindSafe for WebP
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,
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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.
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>,