Struct libheif_rs::HeifContext [−][src]
Implementations
impl HeifContext
[src]
pub fn new() -> Result<HeifContext>
[src]
Create a new empty context.
pub fn read_from_bytes(bytes: &[u8]) -> Result<HeifContext>
[src]
Create a new context from bytes.
pub fn read_from_file(name: &str) -> Result<HeifContext>
[src]
Create a new context from file.
pub fn read_from_reader(reader: Box<dyn Reader>) -> Result<HeifContext>
[src]
Create a new context from reader.
pub fn write_to_bytes(&self) -> Result<Vec<u8>>
[src]
pub fn write_to_file(&self, name: &str) -> Result<()>
[src]
pub fn number_of_top_level_images(&self) -> usize
[src]
pub fn top_level_image_ids(&self, item_ids: &mut [ItemId]) -> usize
[src]
pub fn image_handle(&self, item_id: ItemId) -> Result<ImageHandle<'_>>
[src]
pub fn primary_image_handle(&self) -> Result<ImageHandle<'_>>
[src]
pub fn encoder_for_format(&self, format: CompressionFormat) -> Result<Encoder>
[src]
pub fn encode_image(
&mut self,
image: &Image,
encoder: &mut Encoder,
encoding_options: Option<EncodingOptions>
) -> Result<ImageHandle<'_>>
[src]
&mut self,
image: &Image,
encoder: &mut Encoder,
encoding_options: Option<EncodingOptions>
) -> Result<ImageHandle<'_>>
Compress the input image.
The first image added to the context is also automatically set the primary image, but
you can change the primary image later with [set_primary_image
] method.
[set_primary_image
]: #method.set_primary_image
pub fn set_primary_image(
&mut self,
image_handle: &mut ImageHandle<'_>
) -> Result<()>
[src]
&mut self,
image_handle: &mut ImageHandle<'_>
) -> Result<()>
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for HeifContext
impl !Sync for HeifContext
impl Unpin for HeifContext
impl !UnwindSafe for HeifContext
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,
pub 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, 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.
pub 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>,