Struct libheif_rs::HeifContext[][src]

pub struct HeifContext { /* fields omitted */ }

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]

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]

Trait Implementations

impl Drop for HeifContext[src]

impl Send for HeifContext[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.