pub struct Jpeg { /* private fields */ }
Expand description
The representation of a Jpeg image.
Implementations
sourceimpl Jpeg
impl Jpeg
sourcepub fn from_bytes(b: Bytes) -> Result<Jpeg>
pub fn from_bytes(b: Bytes) -> Result<Jpeg>
Create a Jpeg
from Bytes
Errors
This method fails if the file signature doesn’t match or if it is corrupted or truncated.
sourcepub fn segments(&self) -> &Vec<JpegSegment>
pub fn segments(&self) -> &Vec<JpegSegment>
Get the segments of this Jpeg
sourcepub fn segments_mut(&mut self) -> &mut Vec<JpegSegment>
pub fn segments_mut(&mut self) -> &mut Vec<JpegSegment>
Get a mutable reference to the segments of this Jpeg
sourcepub fn segment_by_marker(&self, marker: u8) -> Option<&JpegSegment>
pub fn segment_by_marker(&self, marker: u8) -> Option<&JpegSegment>
Get the first segment with a marker of marker
sourcepub fn segments_by_marker(
&self,
marker: u8
) -> impl Iterator<Item = &JpegSegment>
pub fn segments_by_marker(
&self,
marker: u8
) -> impl Iterator<Item = &JpegSegment>
Get every segment with a marker of marker
sourcepub fn remove_segments_by_marker(&mut self, marker: u8)
pub fn remove_segments_by_marker(&mut self, marker: u8)
Remove every segment with a marker of marker
sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Get the total size of the Jpeg
once it is encoded
The size is the sum of:
- The SOI marker (2 bytes).
- The size of every segment including the size of the encoded entropy.
sourcepub fn encoder(self) -> ImageEncoder<Self>ⓘNotable traits for ImageEncoder<I>impl<I: EncodeAt> Iterator for ImageEncoder<I> type Item = Bytes;
pub fn encoder(self) -> ImageEncoder<Self>ⓘNotable traits for ImageEncoder<I>impl<I: EncodeAt> Iterator for ImageEncoder<I> type Item = Bytes;
Create an encoder for this Jpeg
Trait Implementations
sourceimpl ImageICC for Jpeg
impl ImageICC for Jpeg
sourcefn icc_profile(&self) -> Option<Bytes>
fn icc_profile(&self) -> Option<Bytes>
Get the raw ICC Profile of this image
sourcefn set_icc_profile(&mut self, profile: Option<Bytes>)
fn set_icc_profile(&mut self, profile: Option<Bytes>)
Overwrites the pre-existing ICC Profile of this image. Read more
impl Eq for Jpeg
impl StructuralEq for Jpeg
impl StructuralPartialEq for Jpeg
Auto Trait Implementations
impl RefUnwindSafe for Jpeg
impl Send for Jpeg
impl Sync for Jpeg
impl Unpin for Jpeg
impl UnwindSafe for Jpeg
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more